Apache CloudStack 4.4 with Advanced Networking Setup Pt. 1

This post is the start of a few posts that will setup a CloudStack environment from scratch then get it to the point where you have advanced networking configured and deploying vm instances. The step of course is to get CloudStack installed. This is pretty easy to do using the cldstk-deploy tool from github. Create a vm and follow the instructions on github to get cldstk-deploy installed and ready to deploy CloudStack environments. The basic steps are shown below.

Setting up the environment

First you will need to have a single VM with CentOS 6.5 for the cldstk-deploy tool.

  1. Download cldstk-deploy from Github.
    yum install git -y
    git clone https://github.com/thehyperadvisor/cldstk-deploy.git
  2. Setup cldstk-deploy using the “setup all” option. This prepares the environment and installs all the required packages for cldstk-deploy (nodejs and ansible).
    cd cldstk-deploy
    python cldstk-deploy.py setup all
  3. Download the Apache Cloudstack RPMS using the “get rpmversion=” option.
    python cldstk-deploy.py get rpmversion=4.4
  4. Download KVM system template.
    python cldstk-deploy.py get systemtemplate=4.4

Now lets deploy CloudStack

RPM packages and system templates must be in downloaded first as shown above. Create 3x VMs or have physical servers configured with:

  • 1x CentOS 6.5, 1GB RAM, 1 CPU for CloudStack Management Server
  • 1X NFS Server with a “primary” and “secondary” mount point configured.
  1. Browse the cldstk-deploy directory then run the command below.
  python cldstk-deploy.py
  1. This will start asking questions from the command prompt. Next all you have to do is answer the questions. Follow as shown below.

Enter Password Here: <——- ENTER ROOT PASSWORD

Install all-in-one?Y/n: n
Install Primary Database Server?Y/n: y
Configure Database Replica?Y/n: n
Install Primary Management Server?Y/n: y
Install additional Management servers?Y/n: n
Install KVM Hosts?Y/n: y
Comma separated list:, <— IP/DNS OF KVM SERVERS
Install System Templates?Y/n: y
NFS Path/nfsdirpath: /mnt/volume1/secondary <— PATH TO NFS SECONDARY
Change install type to “Internet”?Y/n: n
Which version to install4.2, 4.3, 4.4?: 4.4
Add ssh rsa keys to /.ssh/knownhosts?Y/n: y
ansible hosts file successfully writing to disk…..
varsfile successfully writing to disk….. SSH-2.0-OpenSSH5.3 SSH-2.0-OpenSSH5.3 SSH-2.0-OpenSSH5.3
Create Basic Zone?Y/n: n
No Basic Zone will be created
Start installation now?Y/n: y

  1. The deployment will begin and when it’s all done you should see the following with no failures.
TASK: [Ensure  NFS storage is mounted] ****************************************
changed: []

TASK: [Seed secondary storage] ************************************************
changed: [] {'unreachable': 0, 'skipped': 13, 'ok': 56, 'changed': 37, 'failures': 0} {'unreachable': 0, 'skipped': 0, 'ok': 25, 'changed': 19, 'failures': 0} {'unreachable': 0, 'skipped': 0, 'ok': 25, 'changed': 19, 'failures': 0} {'unreachable': 0, 'skipped': 6, 'ok': 14, 'changed': 4, 'failures': 0}
  1. Once done you should be able to login into your CloudStack management server using the url “http://managementserver:8080/client”.

Here is a video of the process.



Add yours
    • 3
      Antone Heyward

      I don’t think it does based on this: https://raw.githubusercontent.com/openvswitch/ovs/master/FAQ. Please correct me if I’m wrong.

      Q: What Linux kernel versions does each Open vSwitch release work with?

      A: The following table lists the Linux kernel versions against which the
      given versions of the Open vSwitch kernel module will successfully
      build. The Linux kernel versions are upstream kernel versions, so
      Linux kernels modified from the upstream sources may not build in
      some cases even if they are based on a supported version. This is
      most notably true of Red Hat Enterprise Linux (RHEL) kernels, which
      are extensively modified from upstream.

      Open vSwitch \\ Linux kernel
      ———— \\ ————-
      1.4.x \\ 2.6.18 to 3.2
      1.5.x \\ 2.6.18 to 3.2
      1.6.x \\ 2.6.18 to 3.2
      1.7.x \\ 2.6.18 to 3.3
      1.8.x \\ 2.6.18 to 3.4
      1.9.x \\ 2.6.18 to 3.8
      1.10.x \\ 2.6.18 to 3.8
      1.11.x \\ 2.6.18 to 3.8
      2.0.x \\ 2.6.32 to 3.10
      2.1.x \\ 2.6.32 to 3.11
      2.2.x \\ 2.6.32 to 3.14

      • 4

        Yeah, that makes sense. In order to perform GRE isolation with OpenVSwitch I built the 3.14.19 kernel and installed. OVS worked without a hitch. When I attempted to add the host to Cloudstack 4.4, I got a CGroup error. A RHEL support link directed me to a post that said 3.14.19 didn’t have a proper version of the CGroup utility.

        Thanks for the response. Now that I am looking at the ovs post a little closer, looks like 2.2.x supports kernel 2.6.32 which is CentOS native. Gah! But back to my install.

  1. 5

    Hi Antone,

    Thanks for the great post. I ran into the below error;

    TASK: [cldstk-mysql | Update mysql root password for all root accounts] *******
    failed: [] => (item= => {“failed”: true, “item”: “”, “parsed”: false}
    invalid output was: Traceback (most recent call last):
    File “/root/.ansible/tmp/ansible-tmp-1415108405.29-23907014694690/mysql_user”, line 1822, in
    File “/root/.ansible/tmp/ansible-tmp-1415108405.29-23907014694690/mysql_user”, line 466, in main
    changed = user_add(cursor, user, host, password, priv)
    File “/root/.ansible/tmp/ansible-tmp-1415108405.29-23907014694690/mysql_user”, line 164, in user_add
    cursor.execute(“CREATE USER %s@%s IDENTIFIED BY %s”, (user,host,password))
    File “/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py”, line 173, in execute
    self.errorhandler(self, exc, value)
    File “/usr/lib64/python2.6/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
    raise errorclass, errorvalue
    _mysql_exceptions.OperationalError: (1396, “Operation CREATE USER failed for ‘root’@’testcloud.local

    Just wanted to check if this was something you encountered as well and how you got around it.



  2. 9

    does it mean that we have to download and install xenserver template manually after cloudstack will get deployed using cldstk-deploy script?

  3. 13

    script is asking additional question: “whats the current DB server?[dns/ip]” what does it mean? we have already given primary and secondary management server ip and primary, replica database server ip, what is the meaning of current DB server?

  4. 15

    Install all-in-one?Y/n: n
    Install Primary Database Server?Y/n: y
    Db Serverdns/ip: 192.168.x.x
    Configure Database Replica?Y/n: y
    replica ip: 192.168.x.x
    Install Primary Management Server?Y/n: y
    Serverdns/ip: 192.168.x.x
    Install additional Management servers?Y/n: y
    Additional management server ip: 192.168.x.x
    whats the current DB server?[dns/ip] ??????

    • 20
      Antone Heyward

      You can change the password by editing the cldstk-deploy.py file. Its at the top and starts at line 22. There is also a vars_file.yml create under the ansible folder. Make sure to change it to something MySql supports.

Comments are closed.