系统平台:ubuntu18.04
openstack:红帽官方v10
构建镜像CentOS7.2
qemu-img create -f qcow2 centos7.2.qcow2 10G
virt-install --virt-type kvm --name centos7.2_base --ram 2048 --disk centos7.2.qcow2,format=qcow2 --network network=vbr --graphics vnc,listen=0.0.0.0 --noautoconsole --os-type=linux --os-variant=rhel7 --cdrom=/doc/CentOS7-1804.iso
virt-viewer centos7.2_base
操作完毕后就可以开始安装系统了,在配置页面设置一个临时密码,安装完成后直接重启系统即可。
安装acpid并设置开机启动,acpid用来处理电源相关事件,对于云主机来说这样关机和重启以及强制重启更加安全。
yum install -y acpid && systemctl enable acpid
yum install -y cloud-init && systemctl enable cloud-init
yum install -y cloud-utils-growpart.noarch
rpm -qa kernel | sed 's/^kernel-//' | xargs -I {} dracut -f /boot/initramfs-{}.img {}
shutdown -h now
virt-sysprep -d centos7.2_base
virsh undefine centos7.2_base
source keystonerc_admin
glance image-create --file /centos7.4.qcow2 --disk-format qcow2 --container-format bare --name CentOS7.4 --progress
原文:https://www.cnblogs.com/lqinghua/p/11854380.html