Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Development/testing notes

After you have your development environment setup, here are additional things to note:

At a high level, you will need to run the management server, the KVM host, and an LXC host. The LXC host has the exact same setup as the KVM host, the only difference is you specify the "lxc" hypervisor in the agent config file. The KVM host is needed for running the System VMs since we do not yet have equivalents for LXC.

I am currently running my dev/test setup on two machines: 1) runs the management + KVM agent and 2) the other runs the LXC agent. The following sections detail how to get the development code running so that you can spin up LXC containers with Cloudstack. It's not very elegant, but is the easiest way I've found to quickly get the system up with development code. There's probably an easier way to do this.

1. Install CS 4.0

2. Checkout and build latest code

  • Checkout and build the code on both machines 1 and 2
    • git clone git@github.com:gilt/incubator-cloudstack.git
    • cd incubator-cloudstack
    • mvn clean install

3. Setup management server

  • Run the management server
    • mvn -pl :cloud-client-ui jetty:run

4. Configuring the agents

  • On machine 2, edit On the LXC host, modify /etc/cloud/agent/agent.properties and add
    • add: hypervisor.type=lxc
  • Modify /etc/init.d/cloud-agent
    • Replace the "export CLASSPATH" line with
    • Code Block
      
      PCP=""
      for jarfile in <incubator-cloudstack-dir>/client/target/cloud-client-ui-4.1.0-SNAPSHOT/WEB-INF/lib/cloud-* /usr/share/java/jna.jar; do
          if [ ! -e "$jarfile" ] ; then continue ; fi
          echo "got here: $jarfile"
          PCP=$jarfile:$PCP
      done
      export CLASSPATH="$SCP:$DCP:$PCP:$JCP:/etc/cloud/agent:/usr/lib64/cloud/agent"
      
  • Restart cloud-agent on both machines
    • service cloud-agent restart

5. Setup KVM, modify SSVM

In this step we bring up the system with a KVM hypervisor. After the Secondary Storage VM starts up, we will swap out the cloud jars with the ones we've built.

  • From the CS UI: add a zone, pod, cluster, host, primary, and secondary for KVM
  • After the Secondary Storage VM starts up:
    • Code Block
      
      ssh -i /root/.ssh/id_rsa.cloud -p 3922 root@169.254.x.x (SSVM local link ip)
      cp -r /usr/local/cloud/systemvm /usr/local/cloud/systemvm.orig
      rm 
    We do not yet have LXC System VMs.
    • Make sure you have a KVM/Xen host to run the System VMs for your setup.
    • On the SSVM, replace
      /usr/local/cloud/systemvm/cloud-*.jar
      scp root@<machine1>:<incubator-cloudstack-dir>/client/target/cloud-client-ui-4.1.0-SNAPSHOT/WEB-INF/lib/cloud-*.jar
      with cloud jars from your build
       /usr/local/cloud/systemvm
      service cloud stop
      service cloud start
      

6. Setup LXC

  • From the CS UI: add a cluster, host, primary for LXC
  • Wait for the SSVM to download the Centos 6.3 LXC image
  • Create an LXC instance
  • Login with cloud/cloudDatamodel includes a sample LXC image that will be downloaded by the SecondaryStorage VM. There is an account with sudo: cloud/cloud.