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 104: Line 104:
 
Output will show the virtuozzo storage cluster properties and state.
 
Output will show the virtuozzo storage cluster properties and state.
  
Configure the script on the COMPUTE node. Please read script description here https://github.com/virtuozzo/virtuozzo-openstack-scripts/blob/master/README.md
+
Configure the script on the COMPUTE node. Please read script description here https://github.com/virtuozzo/virtuozzo-openstack-scripblob/master/README.md
  
 
Example:
 
Example:
Line 125: Line 125:
 
  virt_type = parallels
 
  virt_type = parallels
 
  images_type = qcow2
 
  images_type = qcow2
  connection_uri = vz:///system
+
  connection_uri = parallels:///system
  
 
Delete the line:
 
Delete the line:
Line 151: Line 151:
  
  
* Install Virtuozzo Platform Release package to all Virtuozzo OpenStack nodes:
+
* Create a new repo file:
  
  $ yum install vz-platform-release
+
cat > /etc/yum.repos.d/virtuozzo-extra.repo << _EOF
 +
[virtuozzo-extra]
 +
name=Virtuozzo Extra
 +
baseurl=http://repo.virtuozzo.com/openstack/newton/x86_64/os/
 +
enabled=1
 +
gpgcheck=1
 +
priority=50
 +
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7
 +
_EOF
 +
 
 +
* Add RDO repository:
 +
 +
  $ yum install https://rdoproject.org/repos/rdo-release.rpm
  
 
* Install packstack package:
 
* Install packstack package:
Line 161: Line 173:
 
* Download sample Vz7 packstack answer file:
 
* Download sample Vz7 packstack answer file:
  
  $ wget https://raw.githubusercontent.com/virtuozzo/virtuozzo-openstack-scripts/master/vz7-packstack-ocata.txt
+
  $ wget https://raw.githubusercontent.com/virtuozzo/virtuozzo-openstack-scripts/master/vz7-packstack-sample.txt
 
 
* Edit vz7-packstack-ocata.txt enabling/disabling necessary services
 
* Replace all references to 'localhost' and '127.0.0.1' host addresses to correct valuses
 
* Set all passwords parameters containing PW_PLACEHOLDER string to some meaninful values
 
* If you are going to use Virtuozzo Storage as a Cinder Volume backend set the following parameters:
 
 
 
  # Enable Virtuozzo Storage
 
  CONFIG_VSTORAGE_ENABLED=y
 
 
 
  # VStorage cluster name.
 
  CONFIG_VSTORAGE_CLUSTER_NAME=
 
 
 
  # VStorage cluster password.
 
  CONFIG_VSTORAGE_CLUSTER_PASSWORD=
 
 
 
  # Bridge mappings
 
  CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=extnet1:br-ex
 
  
  # Bridge interfaces
+
* Edit vz7-packstack-sample.txt enabling/disabling necessary services. Also make sure you have correct IP addresses specified by the following parameters in the file:
  CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth0
 
  
  # Bridge mapping for compute node
+
CONFIG_CONTROLLER_HOST
  CONFIG_NEUTRON_OVS_BRIDGES_COMPUTE=extnet1:br-ex
+
CONFIG_COMPUTE_HOSTS
 +
CONFIG_NETWORK_HOSTS
 +
CONFIG_AMQP_HOST
 +
CONFIG_MARIADB_HOST
 +
CONFIG_REDIS_HOST
  
 +
* Change CONFIG_DEFAULT_PASSWORD parameter!!!
 
* Then run packstack:
 
* Then run packstack:
  
  $ packstack --answer-file=vz7-packstack-ocata.txt
+
  $ packstack --answer-file vz7-packstack-sample.txt
  
 
== Install and configure a nova controller node on [[Virtuozzo]] 7 (*Production Setup*) == <!--T:18-->
 
== Install and configure a nova controller node on [[Virtuozzo]] 7 (*Production Setup*) == <!--T:18-->
Line 194: Line 193:
 
<!--T:19-->
 
<!--T:19-->
 
* Follow instructions on [http://docs.openstack.org/newton/install-guide-rdo/nova-controller-install.html OpenStack.org]
 
* Follow instructions on [http://docs.openstack.org/newton/install-guide-rdo/nova-controller-install.html OpenStack.org]
 +
* Change disk_formats string in /etc/glance/glance-api.conf so that it contains 'ploop'. Like this:
 +
 +
disk_formats = ami,ari,aki,vhd,vmdk,raw,qcow2,vdi,iso,ploop
 +
 +
* Restart glance-api service:
 +
 +
systemctl restart openstack-glance-api.service
  
 
* Download the container [http://updates.virtuozzo.com/server/virtuozzo/en_us/odin/7/techpreview-ct/centos7-exe.hds.tar.gz image]
 
* Download the container [http://updates.virtuozzo.com/server/virtuozzo/en_us/odin/7/techpreview-ct/centos7-exe.hds.tar.gz image]
Line 203: Line 209:
 
NOTE: this image was created for testing purposes only. Don't use it in production as is!
 
NOTE: this image was created for testing purposes only. Don't use it in production as is!
  
  $ glance image-create --name centos7-exe --disk-format ploop --min-ram 512 --min-disk 1 --container-format bare --property vm_mode=exe --property hypervisor_type=vz --property cinder_img_volume_type=vstorage-ploop --file centos7-exe.hds
+
  $ glance image-create --name centos7-exe --disk-format ploop --container-format bare --property vm_mode=exe --property hypervisor_type=vz --property cinder_img_volume_type=vstorage-ploop --file centos7-exe.hds
  
  $ glance image-create --name centos7-hvm --disk-format qcow2 --min-ram 1024 --min-disk 10 --container-format bare --property cinder_img_volume_type=vstorage-qcow2 --file CentOS-7-x86_64-GenericCloud.qcow2
+
  $ glance image-create --name centos7-hvm --disk-format qcow2 --container-format bare --property cinder_img_volume_type=vstorage-qcow2 --file CentOS-7-x86_64-GenericCloud.qcow2
  
* CentOS image one can get here [http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 ]
+
* CentOS image one can get from [http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 here]
  
 
== Install and configure a compute node on [[Virtuozzo]] 7 (*Production Setup*) == <!--T:16-->
 
== Install and configure a compute node on [[Virtuozzo]] 7 (*Production Setup*) == <!--T:16-->
  
 
<!--T:17-->
 
<!--T:17-->
Please use this chapter if you are going to run containers OR virtual machines on your compute node, but not containers AND virtual machines simultaneously. If you need to run containers and VMs simultaneously, please use next chapter.
 
 
 
* Follow instructions on [http://docs.openstack.org/newton/install-guide-rdo/nova-compute-install.html OpenStack.org]
 
* Follow instructions on [http://docs.openstack.org/newton/install-guide-rdo/nova-compute-install.html OpenStack.org]
 
* In addition to above instructions change /etc/nova/nova.conf:
 
* In addition to above instructions change /etc/nova/nova.conf:
Line 225: Line 229:
 
  [libvirt]
 
  [libvirt]
 
  ...
 
  ...
vzstorage_mount_user = nova
 
 
  vzstorage_mount_group = root
 
  vzstorage_mount_group = root
 
  virt_type = parallels
 
  virt_type = parallels
 
  images_type = ploop
 
  images_type = ploop
  connection_uri = vz:///system
+
  connection_uri = parallels:///system
  
 
* Remove 'cpu_mode' parameter or set the following:
 
* Remove 'cpu_mode' parameter or set the following:
  
  cpu_mode = none
+
  cpu_mode=none
 
+
 
 
* Then restart nova-compute service:
 
* Then restart nova-compute service:
  
Line 244: Line 247:
  
 
<!--T:17-->
 
<!--T:17-->
If you are going to run containers AND virtual machines simultaneously on your compute node you have to use this approach.
 
 
 
* Follow instructions on [http://docs.openstack.org/mitaka/install-guide-rdo/cinder-controller-install.html OpenStack.org]
 
* Follow instructions on [http://docs.openstack.org/mitaka/install-guide-rdo/cinder-controller-install.html OpenStack.org]
 
* In addition to above instructions change /etc/cinder/cinder.conf:
 
* In addition to above instructions change /etc/cinder/cinder.conf:
Line 284: Line 285:
 
* Authenticate your Virtuozzo Storage client nodes in oreser to allow them to mount cluster:
 
* Authenticate your Virtuozzo Storage client nodes in oreser to allow them to mount cluster:
  
  $ echo $CLUSTER_PASSWD | vstorage auth-node -c YOUR-CLUSTER-NAME -P
+
  $ echo $CLUSTER_PASSWD | vstorage auth-node -c cc -P
 
   
 
   
 
* Then restart cinder services:
 
* Then restart cinder services:
Line 292: Line 293:
 
  $ systemctl restart openstack-cinder-volume
 
  $ systemctl restart openstack-cinder-volume
  
== How to create a new ploop image ready to upload to Glance == <!--T:17-->
+
== How to create a new image ploop image ready to upload to Glance == <!--T:17-->
  
 
* Select os template. The following templates are possible: vzlinux-7, centos-7, ubuntu-16.04, ubuntu-14.04, debian-8.0, centos-6, debian-8.0-x86_64-minimal
 
* Select os template. The following templates are possible: vzlinux-7, centos-7, ubuntu-16.04, ubuntu-14.04, debian-8.0, centos-6, debian-8.0-x86_64-minimal
Line 317: Line 318:
  
 
  $ 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 341: Line 333:
 
  _EOF
 
  _EOF
  
* 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 withing 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 353:
 
  $ 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: