CloudStack Development for KVM in a Virtual Machine

download CloudStack Development for KVM in a Virtual Machine

If you can't read please download the document

Transcript of CloudStack Development for KVM in a Virtual Machine

PowerPoint Presentation

CloudStack Development for KVM
in a Virtual Machine

Purpose
To familiarize programmers with developing for CloudStack using a virtualized KVM host


* specific to KVM agent
* general development, prefer to run KVM
* most devs have their own way, this is mine

Prerequisites

Computer

Hypervisor capable of running nested virtualizationVMware Fusion 6 Pro + MacOS

Linux w/KVM, nested=1 kvm module parameter

4GB of free RAM (8GB+ total system ram)

Internet Connection For download of source, VM templates, wiki instructions

* Need vmx cpu flag for KVM modules
* have tried running qemu emulation, slow
* Multi-core cpu preferred, not required

DevCloud Development Models

Full Stack in VM

Split Manager/Agent

* everything in the vm vs mgmt server in workstation* some choose to split this out further* you can even run multiple devclouds if you have ram

Installation:
MacOS w/VMware Fusion

Install VMware Fusion 6 Professional

Set up networks, VMware Fusion Preferences

* Fusion 6 pro provides the network editor
* create two networks* vmnet2 is mgt* vmnet3 is pub

Setup vmnet2

mgt network is 172.17.10.0/24use of NAT is not required

Setup vmnet3

* public net is set up as 192.168.100.0/24* use of NAT allows us to use the workstation's connection to download templates

3. Download DevCloud-KVM VM for VMware Fusion: http://marcus.mlsorensen.com/cloudstack-extras/devcloud-kvm-fusion.tar.gz

4. Extract package via double-click in Finder5. Navigate folder, right click VM Open With VMware FusionSelect I moved it, which will preserve MAC addresses

* Preconfigured CentOS 6.5 Virtual Machine* Selecting 'moved' copies mac

Installation:
Linux w/KVM

1. Verify nested KVM capability

2. Download DevCloud-KVM package for Linux KVM

3. Extract archive

*Nested means that the DevCloud VM will have the vmx flag and will be capable of loading the kvm kernel modules inside the guest.*kvm_intel module has it disabled by default, kvm_amd has it enabled by default

* Extract package to where you want the vm to live

4. Install networks

* preconfigured xml network definitions, same as for VMware with first network as mgt and second as pub

5. Edit file devcloud-kvm.xml, change path for qcow2 image to match actual path on workstation

6. Register and start VM

*change path for qcow2 image to the actual path, save* tell virsh about the vm* start the vm

Inside DevCloud-KVM
ssh [email protected]
password : password

Installing CloudStack from Source

* I usually build/install via packages to ensure dependencies all get put in place, otherwise copying jars is fine

Deploying A Zone

* can create your own zone definitions for quick deployment or testing* uses marvin, which is a testing framework written in python. Handles CS API and is used to write smoke tests

Network

Main difference between VMware and KVM devcloud images is that the gateway is set to .2 for vmware

Key KVM Agent Classes

LibvirtComputingResourcePrimary handler of *Command classes

VirtualRoutingResourceHandles Virtual Router programming *Command classes

LibvirtVMDefHandles putting together Libvirt XML for guests

KVMStorageProcessorHandles most storage related *Command classes

StorageAdaptorInterface for implementing a storage pool (agent-side storage plugins)

VifDriverInterface for implementing vm nic plug, unplug (network plugin)

Extend VifDriverBase

Resources

https://cwiki.apache.org/confluence/display/CLOUDSTACK/DevCloud-kvm

https://cwiki.apache.org/confluence/display/CLOUDSTACK/Marvin+-+Testing+with+Python

http://marcus.mlsorensen.com/cloudstack-extras

Presentation Title

Presentation Subtitle

Presentation Subtitle

Subsection Title

Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level

Presentation Subtitle