制作centos6.5 镜像,安装cloud-init 支持openstack 密码注入
来源:互联网 发布:非洲知乎 编辑:程序博客网 时间:2024/06/05 20:13
Centos7 直接yum安装cloud-init 即可
Steps to create a CentOS image
- Use virt-manager to install CentOS with a small disk (I used one of 10 GB) and do aminimal install, make special note of the name as it will be used later, for this guide the name chosen iscentos-6.5. Also, during installation you need to create only one partition for / in ext4 format (this means, no lvm, no swap, etc.)
- Alternatively you could do something like:
$ qemu-img create -f qcow2 /tmp/centos-6.5-working.qcow2 10G$ virt-install --virt-type kvm --name centos-6.5 --ram 1024 \--cdrom=/tmp/CentOS-6.5-x86_64-minimal.iso \--disk /tmp/centos-6.5-working.qcow2,format=qcow2 \--network network=default \--graphics vnc,listen=0.0.0.0 --noautoconsole \--os-type=linux --os-variant=rhel6
- After install, reboot the vm and log in as root.
- Modify /etc/sysconfig/network-scripts/ifcfg-eth0 so it looks like the following (the important bits are: no mac defined and bootproto dhcp):
TYPE=EthernetDEVICE=eth0ONBOOT=yesBOOTPROTO=dhcpNM_CONTROLLED=no
- Install the EPEL repository
$ yum install -y http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
- Update the system
$ yum -y distro-sync
- Install cloud-init packages and git (this one is required to install linux rootfs resize)
yum install -y cloud-utils cloud-init parted git
- Install linux rootfs resize
cd /tmpgit clone https://github.com/flegmatik/linux-rootfs-resize.gitcd linux-rootfs-resize./install
- Edit /etc/cloud/cloud.cfg and under cloud_init_modules add:
- resolv-conf
- Add the following line to /etc/sysconfig/network (this is to avoid problems accessing the EC2 metadata service)
NOZEROCONF=yes
- Poweroff the vm
$ poweroff
- Reset and clean the image so it can be reused without issues
$ virt-sysprep -d centos-6.5
- Reduce image size by zero-in unused blocks in the virtual disk (Run as root to avoid issues changing selinux context on the final step)
$ virt-sparsify --compress /tmp/centos-6.5-working.qcow2 centos-6.5-cloud.qcow2
You're done!
The image centos-6.5-cloud.qcow2 is ready to be uploaded to Openstack.
0 1
- 制作centos6.5 镜像,安装cloud-init 支持openstack 密码注入
- 制作centos6.5 镜像,安装cloud-init 支持openstack 密码注入
- ubuntu安装cloud-init制作成openstack镜像---cloud-init篇
- openstack制作centos6.5镜像
- openstack 制作winserver2008_R2镜像 用cloudbase-init 实现第一次创建就注入密码(需登录)
- openstack 制作winserver2008_R2镜像 用cloudbase-init 实现第一次创建就注入密码(需登录)
- openstack 密码注入之cloud-init 简单介绍
- powerkvm cloud-init镜像制作
- cloud-init制作centos7镜像
- 制作openstack用的centos6.5镜像
- openstack中CentOS6.2镜像制作
- 制作CentOS6.9的OpenStack镜像
- Openstack Windows server2008R2镜像制作流程(自动注入密码,修改主机名,获取元数据)
- OpenStack解决非UEC镜像的虚拟机cloud-init不工作不能自动修改主机名称不能注入user data
- CentOS6.3下为OpenStack制作CentOS镜像
- CentOS6.3下为OpenStack制作Windows镜像
- CentOS6.3下为OpenStack制作Windows镜像
- CentOS6.3下为OpenStack制作CentOS镜像
- docker - 从安装到部署一个web应用(go、java)
- Spring 如何读取properties文件内容
- SQL查询语句
- 数据库-封锁(locking)
- 单例模式将配置文件加载在jvm内存,修改配置文件,可调用reload方法重新加载至内存
- 制作centos6.5 镜像,安装cloud-init 支持openstack 密码注入
- HDU,1232,畅通工程
- 将color转为UIImage
- tomcat+servlet例子
- 垂直外边距合并--CSS的Margin属性:详解margin属性
- Navicat中应用程序角色设计器的用处
- android Activity之间的数据交换
- linux环境配置文件分类
- IOS入门知识点汇总