大佬教程收集整理的这篇文章主要介绍了制作OpenStack云平台centos6.5镜像,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
创建虚拟镜像
# qemu-img create -f raw Cloud_Centos6.5_64bit.img 10G
[@L_944_0@ ~]# ll /opt/CentOS-6.5-x86_64-bin_DVD.iso -rw-r--r-- 1 root root 4471971840 Aug 21 2016 /opt/CentOS-6.5-x86_64-bin_DVD.iso [[email protected] ~]# [[email protected] ~]# cd /tmp/ [[email protected] tmp]# [[email protected] tmp]# qemu-img create -f raw Cloud_Centos6.5_64bit.img 10G FormatTing ‘Cloud_Centos6.5_64bit.img‘,fmt=raw size=10737418240 [[email protected] tmp]# [[email protected] tmp]# ll Cloud_Centos6.5_64bit.img -rw-r--r-- 1 root root 10737418240 Jan 20 02:08 Cloud_Centos6.5_64bit.img [@L_944_0@ tmp]#
创建KVM虚拟机,并启动
# virt-install --name Cloud_Centos6.5_64bit --ram 1024 --vcpus=1 --disk path=Cloud_Centos6.5_64bit.img --network network:default,model=virtio --arch=x86_64 --os-type=linux --os-variant=rHel6 --graphics vnc,port=5910 --cdrom /opt/CentOS-6.5-x86_64-bin_DVD.iso
[[email protected] tmp]# virt-install --name Cloud_Centos6.5_64bit --ram 1024 --vcpus=1 --disk path=Cloud_Centos6.5_64bit.img --network network:default,port=5910 --cdrom /opt/CentOS-6.5-x86_64-bin_DVD.iso StarTing install... CreaTing domain... | 0 B 00:00 CAnnot open display: Run ‘virt-viewer --Help‘ to see a full list of available command line options Domain installation still in progress. You can reconnect to the console to complete the installation process. [[email protected] tmp]#
[[email protected] tmp]# virsh list --all Id Name State ---------------------------------------------------- - centos7 shut off - Cloud_Centos6.5_64bit shut off - Cloud_win7_64bit shut off [[email protected] tmp]# [[email protected] tmp]# virsh start Cloud_Centos6.5_64bit Domain Cloud_Centos6.5_64bit started [[email protected] tmp]# [[email protected] tmp]# virsh list --all Id Name State ---------------------------------------------------- 2 Cloud_Centos6.5_64bit running - centos7 shut off - Cloud_win7_64bit shut off [[email protected] tmp]#
修改centos6.5虚拟机的网卡,并重启
查看IP地址
关机shutdown
转换格式
# qemu-img convert -f raw -O qcow2 Cloud_Centos6.5_64bit.img Cloud_Centos6.5_64bit.qcow2
[[email protected] tmp]# ll @R_689_10586@l 21296264 -rw-r--r-- 1 root root 10737418240 Jan 20 02:40 Cloud_Centos6.5_64bit.img -rw-r--r-- 1 root root 3028287488 Jan 20 02:44 Cloud_Centos6.5_64bit.qcow2
上传到OpenStack中
# glance image-create --name Cloud_Centos6.5_64 --disk-format qcow2 --container-format bare --is-public true --progress < /tmp/Cloud_Centos6.5_64bit.qcow2
[[email protected]ontroller ~]# glance image-create --name Cloud_Centos6.5_64 --disk-format qcow2 --container-format bare --is-public true --progress < /tmp/Cloud_Centos6.5_64bit.qcow2 [=============================>] 100% +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | d6e6a71c69f1996350970489f9513402 | | container_format | bare | | created_at | 2019-01-19T19:02:32 | | deleted | false | | deleted_at | None | | disk_format | qcow2 | | id | fa28fbc9-cd3f-45f7-bb94-8fc8a09fc95c | | is_public | True | | min_disk | 0 | | min_ram | 0 | | name | Cloud_Centos6.5_64 | | owner | 78f68e3b1a9a4e99818901638995aa36 | | protected | false | | size | 3028287488 | | status | active | | updated_at | 2019-01-19T19:03:56 | | virtual_size | None | +------------------+--------------------------------------+ [[email protected] ~]#
完毕
以上是大佬教程为你收集整理的制作OpenStack云平台centos6.5镜像全部内容,希望文章能够帮你解决制作OpenStack云平台centos6.5镜像所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。