我正在使用virt-manager创建不同的虚拟机,而我正在使用linux网桥在不同主机中的虚拟机之间创建连接.
现在,我想拥有一个自动配置服务器,以便我的虚拟机可以根据每个虚拟机的唯一ID自动配置其名称,IP地址,运行一些脚本等.是否可以在非openstack环境中复制某种cloud-init设置?
我尝试以下列方式使用cloud-init数据源NoCloud.首先,我在VM中安装了cloud-init并配置了cloud.cfg:
datasource: NoClouddatasource_List: [ NoCloud ]disable_ec2_Metadata: True
然后,我创建了一个用户数据文件和元数据文件,其中包含以下内容:
用户数据:
#cloud-confighostname: pruebapassword: passw0rdchpasswd: { expire: False }ssh_pwauth: True
元数据:
instance-ID: iID-local01local-hostname: prueba
然后,我生成了一个iso文件:
genisoimage -output seed.iso -volID cIData -jolIEt -rock user-data Meta-data
最后,我已将磁盘连接到VM并启动它.这是XML的相关部分:
<disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/opt/images/seed.iso'/> <backingStore/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/></disk>
当VM启动时,它会说:
2015-05-12 12:12:40,394 - util.py[WARNING]: Getting data from <class 'cloudinit.sources.DataSourceNoCloud.DataSourceNoCloudNet'> Failed * StopPing Read required files in advance (for other mountpoints) [ OK ] * StopPing Read required files in advance (for other mountpoints) [ OK ] * StopPing Read required files in advance (for other mountpoints) [ OK ]2015-05-12 12:12:48,808 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/Meta-data/instance-ID' Failed [3/120s]: request error [httpconnectionPool(host='169.254.169.254',port=80): Max retrIEs exceeded with url: /2009-04-04/Meta-data/instance-ID (Caused by <class 'socket.error'>: [Errno 113] No route to host)]
有关如何使其工作的任何建议?
解决方法Is it possible to replicate a sort of cloud-init setup in a non-openstack environment?
当然.
Cloud-init不需要网络元数据服务(如EC2和OpenStack提供的服务)才能运行.它将很乐意从本地CD-ROM设备读取配置信息;例如,参见this document的“登录到原子机”部分,其中描述了如何创建必要的文件系统.
这是在cloud-init文档中记录的here.
总结以上是内存溢出为你收集整理的linux – 我可以在不使用openstack或EC2的情况下运行cloud-init环境吗?全部内容,希望文章能够帮你解决linux – 我可以在不使用openstack或EC2的情况下运行cloud-init环境吗?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)