使用 运行时,Centos-6.6 vm 映像需要近十分钟的启动时间virsh
。我使用 捕获了日志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
?我可以配置关闭远程服务器调用吗?
答案1
默认情况下,cloud-init 期望从与 Amazon EC2 兼容的元数据服务(例如 OpenStack 中包含的服务以及可能的其他服务)接收元数据。
如果您没有在这样的服务下运行虚拟机,您有两个选择:
禁用或卸载 cloud-init。这是最简单的选项,如果您没有在云服务中运行,那么您应该这样做。例如:
systemctl mask cloud-init
或者...
创建配置驱动器以 ISO CD 映像的形式呈现,其中包含从元数据服务(如果有)获取的元数据,并且永久将镜像附加到虚拟机。您几乎肯定不需要这样做。