This tutorial attempts to describes how to setup an Openstack (Grizzly) Compute Node using XenServer 6.2.0.
Disclaimer: These are the notes I took during my month long Hacking Openstack
venture trying to get it functioning (which I manged to do). I do not claim to be an expert on Openstack therefore I take no responsibility for any hardware or software damages that may occur to your system. I recommend that you perform this tutorial in a sandbox environment.
The configuration setup described in this tutorial is adapted from Bilel Msekni 's OpenStack Grizzly Install Guide which focuses on the Compute Node portion of the setup. The following diagram shows the architectural setup:
It's assumed that you've already have a functioning Controller Node setup somewhere on your network.
- quantum-agent/ - (root directory for quantum resources)
- nova-agent-Linux-x86_64-0.0.1.37.tar.gz - (Agent service ran on instances)
- quantum-xen-plugins.noarch.rpm - (quantum plugins that run in XenServer Dom0)
- quantum-plugin-agent.patch.orig - (Original patch for quantum plugin see: Change I7795446e: Add support for OVS l2 agent in XS/XCP domU)
- quantum-plugin-agent.patch - (modified patch for quantum plugin)
The following set of instructions assumes that the server:
- has atleast 3 NIC
- has atleast 16GB of RAM
- has atleast 2 HD, (1st HD runs the OS, Nth HD storage for VMs)
- BIOS settings has Virtualization turned on
- Pop in the XenServer 6.2.0 installation medium into your server and allow the system to boot from CDROM
- Following the initial boot messages and the Welcome to XenServer screen, select the keyboard layout to use.
- Next, the XenServer End User License Agreement (EULA) is displayed, accept it.
- Next, select Perform clean installation
- If you have multiple local hard disks, choose a Primary Disk for the installation. Select Ok.
- Next, choose which disk(s) you would like to use for virtual machine storage. (Information about a specific disk can be viewed by pressing F5)
- After choosing your disk(s) select Enable thin provisioning
- Select your installation media source (which will be CDROM)
- Skip the Verify installation source option
- Next, set and confirm a root password, which XenCenter will use to connect to the XenServer host.
- Next, set up the primary management interface that will be used to connect to XenCenter. (This will be the first NIC on the system)
- Next, specify the hostname and the DNS configuration, manually or automatically via DHCP. (Choose DHCP)
- Next, select your time zone
- Next, skip NTP option (We will do that differently later on)
- Finally, select Install XenServer, wait until installation completes then reboot the system
The following set of instructions require you to be on the XenServer
- After the XenServer has booted, at the Configuration console select Network and Management Interface
- Select Configure Management Interface and press [enter]
- Next, select the device labeled with eth0
- Next, select Static option from the list
- On the next screen fill in the following:
- IP Address: 192.168.1.232 (Replace this with the appropriate IP on the 192.168.1.0/24 network)
- Netmask: 255.255.255.0
- Gateway: 192.168.1.1
- Hostname: n01-openstack-node
- Next, select the Network Time option
- Next, select Enable NTP Time Synchronization
- Next, select Add an NTP Server and on the next screen enter 192.168.1.231 (Replace with Controller Node IP) and press [enter]
- Next, select Add an NTP Server (again) and on the next screen enter 10.10.7.1 (Replace with Controller Node IP) and press [enter]
- Press alt+F3, which should bring you to the terminal console, then login as root
- Download the plugins package from the quantum-agent folder in this repo and install the package (a little wget magic should do the trick)
- $ rpm -i quantum-xen-plugins.noarch.rpm
Note: Remember to replace UUID (12345678-1234-5678-1234-567812345678) with the actual ID
- $ cd /var/run/sr-mount/12345678-1234-5678-1234-567812345678 && mkdir iso
- $ sr_uuid=$(xe sr-create name-label=LocalISO type=iso device-config:location=/var/run/sr-mount/12345678-1234-5678-1234-567812345678/iso device-config:legacy_mode=true content-type=iso)
- $ xe sr-param-set other-config:i18n-key=local-storage-iso uuid=$sr_uuid
The following set of instructions require XenCenter
-
Open XenCenter and connect this server
-
Next, select the Networking tab
-
Under Networks list, click the Add Network.. button
- In the next screen, select the Single-Server Private Network option and press [next]
- Next, enter a name to represent this network: n01-tenant-network , and press [next]
- Next, press [finish]
-
Under IP Address Configuration on the same tab, click the Configure button
- On the left pane, click Add IP address button
- On the right pane enter the following and then press [ok]:
- Name: Openstack Management
- Network: Network 1
- IP Address: 10.10.7.100 (Replace this with the appropriate IP on the 10.10.7.0/24 network)
- Subnet Mask: 255.255.255.0
-
Next, select the Console tab
-
At the command prompt press [enter]
-
$ xe network-list
-
On the screen search for the name you created for the tenant network in step #3 and make note of the bridge name:
uuid ( RO) : 7a6c5e4b-81cf-4bed-3059-1a20d10f16ae name-label ( RW): n01-tenant-network name-description ( RW): bridge ( RO): xapi0
-
-
Next, add the integration bridge:
- $ ovs-vsctl add-br xapi0
The following set of instructions assumes that you’ve already created a VM instance with Ubuntu Server installed and that you’ve setup the network interfaces (Network-0 and Network-1) to be attached to this VM. Also the instructions require you to be running in privilege mode, either as root or executing sudo before the command
-
Login to your Ubuntu instance and execute the following:
- $ apt-get update -y
- $ apt-get upgrade -y
- $ apt-get dist-upgrade -y
- Reboot (you might have new kernel)
-
Download the quantum-agent folder in this repo
- $ apt-get install git
- $ git clone [email protected]:Donelle/HowTo-Openstack-ComputeNode-Setup.git
-
Install NTP service
- $ apt-get install -y ntp
- edit /etc/ntp.conf with the following:
- #server 0.ubuntu.pool.ntp.org <- Comment out this line
- #server 1.ubuntu.pool.ntp.org <- Comment out this line
- #server 2.ubuntu.pool.ntp.org <- Comment out this line
- #server 3.ubuntu.pool.ntp.org <- Comment out this line
- server [your controller node ip address goes here] i.e. 10.10.7.1
-
Install vlan and bridge-utils
- $ apt-get install -y vlan bridge-utils
- edit /etc/sysctrl.conf with the following:
- net.ipv4.ip_forward=1 <— Uncomment this line by removing the ‘#’
-
Setup the network intefaces in /etc/network/interfaces :
# Internet access interface auto eth0 iface eth0 inet dhcp # Openstack Management interface auto eth1 iface eth1 inet static # replace this ip with the appropriate ip that # the controller will communicate with this node on address 10.10.7.3 gateway 255.255.255.0
-
Now reboot the system
- Install the openVSwitch and add your bridge:
- $ apt-get install -y openvswitch-switch openvswitch-datapath-dkms openvswitch-datapath-source
- Install the Quantum openvswitch agent:
- $ apt-get install -y quantum-plugin-openvswitch-agent
- Configure the quantum plugin:
- $ cd /etc/quantum/plugins/openvswitch/
- $ scp [email protected]:/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini . # Replace the IP with your Controller’s IP
- edit ovs_quantum_plugin.ini:
- tenant_network_type = vlan
- network_vlan_ranges = physnet2:100 :2999
- integration_bridge = xapi0 # This represents the bridge associated with the tenant network created earlier
- bridge_mappings = physnet2:xenbr2 # The bridge used for VM traffic (It will be the bridge associated with the 3rd NIC)
- $ cd /etc/quantum/
- $ scp [email protected]:/etc/quantum/quantum.conf . # Replace the IP with your Controller’s IP
- edit quantum.conf:
- rabbit_host = 10.10.7.1 <— Uncomment this line by removing the ‘#’ and replace the IP with your Controller’s IP
- root_helper = sudo quantum-rootwrap-xen-dom0 /etc/quantum/rootwrap.conf
- $ scp [email protected]:/etc/quantum/api-paste.ini . # Replace the IP with your Controller’s IP
- edit /etc/sudoers.d/quantum_sudoers
- quantum ALL = NOPASSWD: ALL
- Patch Quantum to run agent in dom0 on the XenServer
- $ cd /usr/lib/python2.7/dist-packages/quantum && patch -p1 < ~/HowTo-Openstack-ComputeNode-Setup/quantum-agent/quantum-plugin-agent.patch
- Enter the following at the next prompt:
- $ /etc/quantum/rootwrap.conf [press enter]
- $ chmod +x bin/quantum-rootwrap-xen-dom0 && cp bin/quantum-rootwrap-xen-dom0 /usr/bin/
- Configure quantum rootwrap:
- $ cd /etc/quantum/
- edit rootwrap.conf:
- xenapi_connection_url=http://10.10.7.101
- xenapi_connection_username=root
- xenapi_connection_password=yourpassword
- Restart service
- $ service quantum-plugin-openvswitch-agent restart
- Install Nova Compute and XenAPI:
- $ apt-get install -y nova-compute python-xenapi
- Configure nova-compute:
-
$ cd /etc/nova
-
$ scp [email protected]:/etc/nova/api-paste.ini . # Replace the IP with your Controller’s IP
-
$ scp [email protected]:/etc/nova/nova.conf . # Replace the IP with your Controller’s IP
-
edit nova.conf:
- vncserver_proxyclient_address=192.168.1.232 # Replace the IP with our host’s XenServer Management IP
- public_interface=eth0
- vlan_interface=eth2
- flat_injected=False
- network_host=10.10.7.2 # Replace this with the network node IP
- send_arp_for_ha=True
- multi_host=True
-
edit nova-compute.conf :
[DEFAULT] #debug=True libvirt_type=xen compute_driver=xenapi.XenAPIDriver xenapi_connection_url=http://10.10.7.100 # Replace this with this current's host Openstack Management IP xenapi_connection_username=root xenapi_connection_password=yourpassword xenapi_vif_driver=nova.virt.xenapi.vif.XenAPIOpenVswitchDriver xenapi_ovs_integration_bridge=xapi0 # This represents the bridge associated with the tenant network created earlier xenapi_torrent_images=none sr_matching_filter=default-sr:true
-
- Restart service
- $ service nova-compute restart
- $ cd ./HowTo-Openstack-ComputeNode-Setup/quantum-agent
- $ mkdir nova-agent && tar -xzf nova-agent-Linux-x86_64-0.0.1.37.tar.gz -C ./nova-agent
- $ cd nova-agent
- $ ./installer
- Open XenCenter and select the the VM running OpenStack (I named the vm OpenStack-VM)
- Select the Console tab and then select xs-tools.iso from the drop down list labeled DVD Drive
- Login into the VM from the console and issue the following commands:
- $ mkdir /mnt/xs-tools
- $ mount /dev/xvdd /mnt/xs-tools
- $ cd /mnt/xs-tools/Linux/
- $ bash install.sh (If you get an error run dpkg -i xe-guest-utilities_6.2.0-1120_amd64.deb)
- $ reboot
If you have any questions or comments about the tutorial please feel free to drop me a line :-).
Email: [email protected] Follow Me: @DonelleJr