Currently, many openstack images are created based on Ubuntu.ArticleBut many of my friends, like me, install openstack Based on centos 6.2 and create their own image files. There are almost no articles in this regard, so I have made my own centos6.2 image by referring to creating images and other articles on Ubuntu, And I will share it with you as a record, for future use.
Preparations:
A centos system is installed on the Virtual Machine VMWare, and CentOS-6.2-x86_64-minimal.iso and qemu-KVM are also required.
Yum install KVM
Configure the server of RealVNC on centos.
After preparation, run:
A: qemu-IMG create-F raw centos. IMG 5g
B:/usr/libexec/qemu-KVM-M 1024-CDROM
CentOS-6.2-x86_64-minimal.iso-Drive file = centos. IMG, if = virtio, Index = 1-boot D-net NIC-Net user-nographic-VNC: 1
In this case, connect with the VNC tool (when using vncviewer to connect, you need to remove the hook before adapt to network speed in option), then install centos6.2, and create a partition on the disk. It is best to go to the desktop package and install the development kit. Then, clear the iptables rule and disable SELinux. Set the NIC configuration to DHCP mode.
Note: If a problem occurs after centos is installed and restarted, you can kill the process in B and re-execute/usr/libexec/qemu-KVM-M 1024-drive file = centos. IMG,-boot C-net NIC-nographic-VNC: 1 and then connect with vncviewer again. To ensure that the image can be connected through SSH, make sure that the image sshd service is enabled (that is, service sshd start ).
C: reboot
D: Halt
At this time, you can import the image.
Glance Add name = "centos6.2" is_public = true container_format = ovf disk_format = raw </root/centos. img
At this time, if the glance index shows centos6.2, it indicates that the production is successful.