Editing Setup OpenStack with Virtuozzo 7

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 317: Line 317:
  
 
  $ prlctl exec glance-$ct yum install cloud-init -y
 
  $ 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
 
* Remove the following modules from cloud.cfg
  
  $ sed -i '/- growpart/d' /vz/root/$uuid/etc/cloud/cloud.cfg
+
  $ prlctl exec glance-$ct sed -i '/- growpart/d' /etc/cloud/cloud.cfg
  $ sed -i '/- resizefs/d' /vz/root/$uuid/etc/cloud/cloud.cfg
+
  $ prlctl exec glance-$ct sed -i '/- resizefs/d' /etc/cloud/cloud.cfg
  
 
* Prepare network scripts
 
* Prepare network scripts
  
  cat > /vz/root/$uuid/etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF
+
  cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF
 
  DEVICE=eth0
 
  DEVICE=eth0
 
  ONBOOT=yes
 
  ONBOOT=yes
Line 343: Line 334:
 
* If you need more than one network adapters within a container, make as many copies as you need  
 
* If you need more than one network adapters within a container, make as many copies as you need  
  
  $ cp /vz/root/$uuid/etc/sysconfig/network-scripts/ifcfg-eth0 /vz/root/$uuid/etc/sysconfig/network-scripts/ifcfg-eth1
+
  $ prlctl exec glance-$ct cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
  $ sed -i '/eth0/eth1' /vz/root/$uuid/etc/sysconfig/network-scripts/ifcfg-eth1
+
  $ prlctl exec glance-$ct sed -i '/eth0/eth1' /etc/sysconfig/network-scripts/ifcfg-eth1
  
 
* Perform some cleanup
 
* Perform some cleanup
  
  $ rm -f /vz/root/$uuid/etc/sysconfig/network-scripts/ifcfg-venet0*
+
  $ rm -f /etc/sysconfig/network-scripts/ifcfg-venet0*
  $ rm -f /vz/root/$uuid/etc/resolv.conf
+
  $ rm -f /etc/resolv.conf
 +
 
 +
* Stop the container
 +
 
 +
$ prlctl stop glance-$ct
  
 
* Create ploop disk and copy files
 
* Create ploop disk and copy files
Line 357: Line 352:
 
  $ mkdir /tmp/ploop-$ct/dst
 
  $ mkdir /tmp/ploop-$ct/dst
 
  $ ploop mount -m /tmp/ploop-$ct/dst /tmp/ploop-$ct/DiskDescriptor.xml
 
  $ ploop mount -m /tmp/ploop-$ct/dst /tmp/ploop-$ct/DiskDescriptor.xml
  $ cp -Pr --preserve=all /vz/root/$uuid/* /tmp/ploop-$ct/dst/
+
$ prlctl mount glance-$ct
 +
$ id=$(vzlist glance-$ct | awk ' NR>1 { print $1 }')
 +
  $ cp -Pr --preserve=all /vz/root/$id/* /tmp/ploop-$ct/dst/
 +
$ prlctl umount glance-$ct
 
  $ ploop umount -m /tmp/ploop-$ct/dst/
 
  $ ploop umount -m /tmp/ploop-$ct/dst/
 
* Unmount the container
 
 
$ prlctl umount glance-$ct
 
  
 
* Now the image tmp/ploop-$ct/$ct.hds is ready to be uploaded to Glance
 
* Now the image tmp/ploop-$ct/$ct.hds is ready to be uploaded to Glance

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: