带有cloud-init的Centos6需要更长的启动时间

当使用virsh运行时,Centos-6.6 vm镜像需要几乎10分钟的启动时间。 我使用virsh console捕获日志。 看起来像这样

 ci-info: +-------+---------------+---------------+---------------+-----------+-------+ ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags | ci-info: +-------+---------------+---------------+---------------+-----------+-------+ ci-info: | 0 | 192.168.122.0 | 0.0.0.0 | 255.255.255.0 | eth0 | U | ci-info: | 1 | 0.0.0.0 | 192.168.122.1 | 0.0.0.0 | eth0 | UG | ci-info: +-------+---------------+---------------+---------------+-----------+-------+ 2015-04-25 05:13:41,222 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [50/120s]: unexpected error ['Timeout' object has no attribute 'response'] 2015-04-25 05:14:32,278 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [101/120s]: unexpected error ['Timeout' object has no attribute 'response'] 2015-04-25 05:14:51,322 - DataSourceEc2.py[CRITICAL]: Giving up on md from ['http://169.254.169.254/2009-04-04/meta-data/instance-id'] after 120 seconds 2015-04-25 05:14:51,990 - url_helper.py[WARNING]: Calling 'http://192.168.122.1//latest/meta-data/instance-id' failed [0/120s]: bad status code [404] 2015-04-25 05:14:53,008 - url_helper.py[WARNING]: Calling 'http://192.168.122.1//latest/meta-data/instance-id' failed [1/120s]: bad status code [404] 2015-04-25 05:14:54,022 - url_helper.py[WARNING]: Calling 'http://192.168.122.1//latest/meta-data/instance-id' failed [2/120s]: bad status code [404] 

我的图像试图从远程服务器获取一些元数据。 一旦失败,它会尝试从本地网关收集信息。

这是与cloud-init ? 我可以configurationclosures远程服务器调用?

默认情况下,cloud-init希望从Amazon EC2兼容的元数据服务(例如OpenStack和其他服务中包含的服务)中接收元数据。

如果你没有在这样的服务下运行你的虚拟机,你有两个select:

  1. 禁用或卸载cloud-init。 这是最简单的select,如果你没有运行云服务,那么你应该这样做。 例如:

     systemctl mask cloud-init 

    要么…

  2. 创buildconfiguration驱动器作为ISO CD映像,包含元数据服务(如果已经存在)获取的元数据,并永久将映像连接到虚拟机。 你几乎可以肯定不需要这样做。