74
edits
Changes
→Installing OpenStack with help of packstack on Virtuozzo 7 (*Production Setup*)
{{Virtuozzo}}
<translate>
<!--T:1-->
This howto article describes steps by step installation of how to install OpenStack devstack with on [[Virtuozzo]] 7.== Introduction == Virtuozzo 7 supports OpenStack as cloud management solution since version 6. With Virtuozzo 7 we are going to add a lot of new capabilities to OpenStack integration. This guide describes two ways of installing OpenStack on Virtuozzo nodes. The first is for quick/development/POC needs. The second is for production. Please keep in mind that devstack allows you to install OpenStack for demo/POC/development purposes only. That means it will be reset after host reboot.
<!--T:3-->
You are able to setup OpenStack controller node together with compute node on the same server for demo or test purpose. In this case compute node with Virtuozzo Containers support will be deployed. You can add another compute node with containers or VMs anytime you want as described in Setup OpenStack Compute Node section. Git must be installed on all your Virtuozzo nodes: $ yum install git -y Clone virtuozzo scripts: $ cd /vz $ git clone https://github.com/virtuozzo/virtuozzo-openstack-scripts $ cd virtuozzo-openstack-scripts If you want to use Virtuozzo Storage with OpenStack and your Virtuozzo Storage is running on another node and not on the compute you need to setup Virtuozzo Storage client and authorize compute node in the Virtuozzo Storage Cluster. Setup Virtuozzo Storage client: $ yum install vstorage-client -yCheck cluster discovery is working fine first: $ vstorage discoverOutput will show the discovered clusters.Now you need to authenticate controller node on the Virtuozzo Storage cluster: $ vstorage -c $CLUSTER_NAME auth-nodeEnter the virtuozzo storage cluster password and press Enter. Check the cluster properties: $ vstorage -c $CLUSTER_NAME topOutput will show Virtuozzo storage cluster properties and state. Configure the script on the CONTROLLER node. Please read full script description here https://github.com/virtuozzo/virtuozzo-openstack-scripts/blob/master/README.md Example: $ source vzrc --host_ip 10.24.41.25 --password Virtuozzo1! --use_provider_network true --fixed_range 192.168.0.0/24 --floating_range 10.24.41.0/24 --floating_pool "start=10.24.41.151,end=10.24.41.199" --public_gateway 10.24.41.1 --gateway 192.168.0.1 --vzstorage vstorage1 --mode ALL Run the script on your CONTROLLER node and follow instructions (if any): $ ./setup_devstack_vz7.sh Installation can take up to 30 minutes depending on your Internet connection speed. Finished! == Setup OpenStack Compute Node (*Developer/POC Setup*) == Git must be installed on all your Virtuozzo nodes: $ yum install git -y Clone Virtuozzo scripts to your COMPUTE node: $ cd /vz $ git clone https://github.com/virtuozzo/virtuozzo-openstack-scripts $ cd /vz/virtuozzo-openstack-scripts If you want to use Virtuozzo Storage with OpenStack and your Virtuozzo Storage is running on another node and not on the compute you need to setup Virtuozzo Storage client and authorize compute node in the Virtuozzo Cluster. Setup Virtuozzo Storage client: $ yum install vstorage-client -yCheck cluster discovery is working fine first: $ vstorage discoverOutput will show the discovered clusters.Now you need to authenticate controller node on the Virtuozzo Storage cluster: $ vstorage -c $CLUSTER_NAME auth-nodeEnter the virtuozzo storage cluster password and press Enter. Check the cluster properties: $ vstorage -c $CLUSTER_NAME topOutput 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 Example: $ source vzrc --host_ip 10.24.41.26 --password Virtuozzo1! --use_provider_network true --mode COMPUTE --controller 10.24.41.25 Run the script on your COMPUTE node and follow instructions (if any): $ ./setup_devstack_vz7.sh == How to change Virtualization Type to Virtual Machines on the Compute Node == If you want to use virtual machines instead of containers on your compute node you need to change virtualization type to KVM on the selected compute node. Open nova configuration file: $ vi /etc/nova/nova.conf Change the following lines: [libvirt] ... virt_type = parallels images_type = qcow2 connection_uri = vz:///system Delete the line: inject_partition = -2 Save the file. Restart nova-compute service: $ su stack $ screen -rPress Ctrl-c $ sg libvirtd '/usr/bin/nova-compute --config-file /etc/nova/nova.conf' & echo $! >/vz/stack/status/stack/n-cpu.pid; fg || echo "n-cpu failed to start" | tee "/vz/stack/status/stack/n-cpu.failure" To exit from screen session:Press Ctrl+a+d == How to redeploy OpenStack on the same nodes == Your OpenStack setup will be reset after node restart. To redeploy OpenStack on the same nodes do the following:# <code>cd /vz/virtuozzo-openstack-scripts</code># <code>git pull</code># Run ./setup_devstack_vz7.sh with options you need. == Installing OpenStack with help of packstack on [[Virtuozzo]] 7 (*Production Setup*) == * Install Virtuozzo Platform Release package to all Virtuozzo OpenStack nodes: $ yum install vz-platform-release * Install RDO repopackstack package: $ yum install openstack-packstack * Download sample Vz7 packstack answer file: $ wget https://raw.githubusercontent.com/virtuozzo/virtuozzo-openstack-scripts/master/vz7-packstack-ocata.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=
# Bridge mappings CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=extnet1:br-ex # Bridge interfaces CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth0 # Bridge mapping for compute node CONFIG_NEUTRON_OVS_BRIDGES_COMPUTE=extnet1:br-ex * Then run packstack: $ packstack --answer-file=vz7-packstack-ocata.txt == Install and configure a nova controller node on [[Virtuozzo]] 7 (*Production Setup*) == <!--T:18--> <!--T:519-->Install EPEL repo* Follow instructions on [http://docs.openstack.org/newton/install-guide-rdo/nova-controller-install.html OpenStack.org] * Download the container [http://updates.virtuozzo.com/server/virtuozzo/en_us/odin/7/techpreview-ct/centos7-exe.hds.tar.gz image]* Unpack it $ tar -xzvf centos7-exe.hds.tar.gz * Upload the image to glance: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 $ yum install 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-y GenericCloud.qcow2 * CentOS image one can get here [http://fedora-mirror01cloud.rbccentos.ruorg/pubcentos/epel7/images/epelCentOS-release7-latestx86_64-7.noarchGenericCloud.rpmqcow2 ]
== Install and configure a compute node on [[Virtuozzo]] 7 (*Production Setup*) == <!--T:616-->Install required packages: $ yum install -y git patch redhat-lsb-core euca2ools mysql-connector-python scsi-target-utils
<!--T:717-->Reinstall http 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 mod_wsgi:VMs simultaneously, please use next chapter.
<!--T:17-->
* Then restart cinder services: $ systemctl restart openstack-cinder-api $ su stack systemctl restart openstack-c "cd ~ && git clone gitcinder-scheduler $ systemctl restart openstack-cinder-volume == How to create a new 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 $ ct=centos-7 * Create a new container based on necessary os distribution $ prlctl create glance-$ct --vmtype ct --ostemplate $ct * Set IP address and DNS to be able to connect to internet from the container $ prlctl set glance-$ct --ipadd IPADDR --nameserver DNS_IPADDR * Add additional network adapter $ prlctl set glance-$ct --device-add net --network Bridged --dhcp on * Start the container $ prlctl start glance-$ct * Install cloud-init packet $ 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 $ sed -i '/- growpart/d' /vz/root/$uuid/etc/cloud/gitcloud.openstack.orgcfg $ sed -i '/openstack-devresizefs/d' /vz/root/$uuid/devstack"etc/cloud/cloud.cfg
_EOF
</translate>
[[Category: HOWTO]]