Saturday, November 3, 2012

CloudStack 2.14 + KVM + Openwitch + openflow (Part 3)

Part 3: Install and configure CloudStack Agent with NFS storage and Openvswitch bridge.


In the part 1 and part 2, I have introduced the basic install of CentOS, Openvswitch, CloudStack manager. In this part, I will introduce the CloudStack Agent installation with OVS bridge and NFS storage

After the end of part 2, Host1 and Host2 configuration as following:

Host1

  • Manager interface: cloudbr0 (eth0) - IP: 10.0.0.2/24
  • Guest and Public interface: cloudbr1 (eth1)
  • Sorfware installed: CentOS 6.0, OVS, CloudStack manager and database
Host2

  • Manager interface: cloudbr0 (eth0) - IP: 10.0.0.3/24
  • Guest and Public interface: cloudbr1 (eth1)
  • Sorfware installed: CentOS 6.0, OVS
You have built a NFS server with IP: 10.0.0.4/24 with URL: 10.0.0.4/kvm-ovs. This link will use for Primary storage on KVM cluster.

Now, You must install cloudstack on both hosts.
  • Check for a fully qualified hostname.
    #hostname --fqdn
  • This should return a fully qualified hostname such as "hostX.cloudkvm.com". If it does not edit /etc/hosts so that it does.
  • Remove qemu-kvm. The CloudStack provides a patched version.
    #yum erase qemu-kvm
  •     Disable SELinux
    Set SELinux up to be permissive by default. First, set the SELINUX variable in /etc/selinux/config to “permissive”. This ensures that the CloudStack Agent can run properly on system reboot. Then set SELinux to permissive until the system is rebooted:

    # setenforce permissive

    Install the CloudStack packages. You should have a file in the form of CloudStack-NNNN.tar.gz. Untar the file and and then run the install.sh script inside it.

    # tar xzf CloudStack-2.2.0-1-centos.tar.gz
    # cd CloudStack-2.2.0-1-centos
    # ./install.sh
    Setting up the temporary repository...
    Cleaning Yum cache...
    Loaded plugins: fastestmirror
    11 metadata files removed
    Welcome to the Cloud.com CloudStack Installer.  What would you like to do?

        M) Install the Management Server
        A) Install the Agent
        S) Install the Usage Monitor
        D) Install the database server
        Q) Quit

        > A

    Choose A to install the Agent software 

The CloudStack Agent is now installed. Later in the installation you will add this host to the CloudStack via the Management Server. This step will configure the Agent on the Host. 

The next, you must edit configuration file of CloudStack Agent as following:

#Fri Nov 02 16:38:04 ICT 2012
guest.network.device=cloudbr1
workers=5
private.network.device=cloudbr0
port=8250
resource=com.cloud.agent.resource.computing.LibvirtComputingResource
pod=1
zone=1
guid=c3434f39-0252-3c45-9a42-a713d5bcf456
public.network.device=cloudbr1
cluster=1
local.storage.uuid=80c6bd25-449c-492b-b2c1-43b6abd5ca81
LibvirtComputingResource.id=1
host=10.0.0.X

Note:
To CloudStack Agent can run with OVS bridge you must check brctl command:

#brctl addbr testbridge  => successful with no error
#brctl delbr testbridge   => delete testbridge

Now, you must download CloudStack-NNNN from source code and change some files and rebuild it from source.
/CloudStack-NNN/scripts/vm/network/vnet/modifyvlan.sh, 
/CloudStack-NNN/python/lib/cloud_utils.py
/CloudStack-NNN/target/scripts/util/qemu-ifup
/CloudStack-NNN/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
=> You find the command brctl and replace by the ovs-vsclt command with the command structure of the ovs-vsclt
Example: "brctl show |grep bridge_name"  to "ovs-vsctl show |grep  bridge_name"

Now, you can add Host1 and Host2 and create VMs.

Part 4: Create VM with OVS bridge and configure QoS and network throttling on VMs


No comments:

Post a Comment