Changes

Jump to: navigation, search

Setup OpenStack with Virtuozzo 7

93 bytes added, 15:51, 3 April 2017
no edit summary
$ prlctl exec glance-$ct yum install cloud-init -y
 
* Stop the container and mount it
 
$ prlctl stop glance-$ct
$ prlctl mount glance-$ct
 
* Store the container uuid
 
$ uuid=$(vzlist glance-$ct | awk ' NR>1 { print $1 }')
* Remove the following modules from cloud.cfg
$ prlctl exec glance-$ct sed -i '/- growpart/d' /vz/root/$uuid/etc/cloud/cloud.cfg $ prlctl exec glance-$ct sed -i '/- resizefs/d' /vz/root/$uuid/etc/cloud/cloud.cfg
* Prepare network scripts
cat > /vz/root/$uuid/etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF
DEVICE=eth0
ONBOOT=yes
* If you need more than one network adapters withing a container, make as many copies as you need
$ prlctl exec glance-cp /vz/root/$ct cp uuid/etc/sysconfig/network-scripts/ifcfg-eth0 /vz/root/$uuid/etc/sysconfig/network-scripts/ifcfg-eth1 $ prlctl exec glance-$ct sed -i '/eth0/eth1' /vz/root/$uuid/etc/sysconfig/network-scripts/ifcfg-eth1
* Perform some cleanup
$ rm -f /vz/root/$uuid/etc/sysconfig/network-scripts/ifcfg-venet0* $ rm -f /vz/root/$uuid/etc/resolv.conf * Stop the container  $ prlctl stop glance-$ct
* Create ploop disk and copy files
$ mkdir /tmp/ploop-$ct/dst
$ ploop mount -m /tmp/ploop-$ct/dst /tmp/ploop-$ct/DiskDescriptor.xml
$ prlctl mount glance-$ct $ id=$(vzlist glance-$ct | awk ' NR>1 { print $1 }') $ cp -Pr --preserve=all /vz/root/$iduuid/* /tmp/ploop-$ct/dst/ $ ploop umount -m /tmp/ploop-$ct/dst/ * Unmount the container 
$ prlctl umount glance-$ct
$ ploop umount -m /tmp/ploop-$ct/dst/
* Now the image tmp/ploop-$ct/$ct.hds is ready to be uploaded to Glance
74
edits

Navigation menu