CloudStack Development for
KVM
in a Virtual Machine
CloudStack Development for
KVM
in a Virtual Machine
Purpose
To familiarize programmers with developing for
CloudStack using a virtualized KVM host
Purpose
To familiarize prog...
Prerequisites
1) Computer
● Hypervisor capable of running nested virtualization
−VMware Fusion 6 Pro + MacOS
−Linux w/KVM,...
DevCloud Development ModelsDevCloud Development Models
● Full Stack in VM● Full Stack in VM ● Split Manager/Agent● Split M...
Installation:
MacOS w/VMware Fusion
Installation:
MacOS w/VMware Fusion
1.Install VMware Fusion 6 Professional
2.Set up networks, VMware Fusion → Preferences
Setup vmnet2
Setup vmnet3
3. Download DevCloud-KVM VM for VMware Fusion:
http://marcus.mlsorensen.com/cloudstack-extras/devcloud-kvm-fusion.tar.gz
4...
Installation:
Linux w/KVM
Installation:
Linux w/KVM
1. Verify nested KVM capability
2. Download DevCloud-KVM package for Linux KVM
3. Extract archive
4. Install networks
5. Edit file devcloud-kvm.xml, change path for qcow2 image to
match actual path on workstation
6. Register and start VM
Inside DevCloud-KVM
ssh root@172.17.10.10
password : “password”
Inside DevCloud-KVM
ssh root@172.17.10.10
password : “pass...
Installing CloudStack from SourceInstalling CloudStack from Source
Deploying A ZoneDeploying A Zone
NetworkNetwork
Key KVM Agent ClassesKey KVM Agent Classes
● LibvirtComputingResource
– Primary handler of *Command classes
● VirtualRouti...
ResourcesResources
● https://cwiki.apache.org/confluence/display/CLOUDSTACK/DevClou
● https://cwiki.apache.org/confluence/...
Upcoming SlideShare
Loading in …5
×

CloudStack Development for KVM in a Virtual Machine

1,159 views

Published on

Full setup of CloudStack in a KVM virtual machine, used for testing and/or development.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,159
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
29
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • * specific to KVM agent* general development, prefer to run KVM* most devs have their own way, this is mine
  • * Need vmx cpu flag for KVM modules* have tried running qemu emulation, slow* Multi-core cpu preferred, not required
  • * 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
  • * Fusion 6 pro provides the network editor* create two networks
    * vmnet2 is mgt
    * vmnet3 is pub
  • mgt network is 172.17.10.0/24
    use of NAT is not required
  • * 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
  • * Preconfigured CentOS 6.5 Virtual Machine
    * Selecting 'moved' copies mac
  • *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
  • * preconfigured xml network definitions, same as for VMware with first network as mgt and second as pub
  • *change path for qcow2 image to the actual path, save
    * tell virsh about the vm
    * start the vm
  • * I usually build/install via packages to ensure dependencies all get put in place, otherwise copying jars is fine
  • * 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
  • Main difference between VMware and KVM devcloud images is that the gateway is set to .2 for vmware
  • CloudStack Development for KVM in a Virtual Machine

    1. 1. CloudStack Development for KVM in a Virtual Machine CloudStack Development for KVM in a Virtual Machine
    2. 2. Purpose To familiarize programmers with developing for CloudStack using a virtualized KVM host Purpose To familiarize programmers with developing for CloudStack using a virtualized KVM host
    3. 3. Prerequisites 1) Computer ● Hypervisor capable of running nested virtualization −VMware Fusion 6 Pro + MacOS −Linux w/KVM, nested=1 kvm module parameter ● 4GB of free RAM (8GB+ total system ram) 2) Internet Connection ● For download of source, VM templates, wiki instructions
    4. 4. DevCloud Development ModelsDevCloud Development Models ● Full Stack in VM● Full Stack in VM ● Split Manager/Agent● Split Manager/Agent
    5. 5. Installation: MacOS w/VMware Fusion Installation: MacOS w/VMware Fusion
    6. 6. 1.Install VMware Fusion 6 Professional 2.Set up networks, VMware Fusion → Preferences
    7. 7. Setup vmnet2
    8. 8. Setup vmnet3
    9. 9. 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 Finder 5. Navigate folder, right click VM → Open With → VMware Fusion Select “I moved it”, which will preserve MAC addresses
    10. 10. Installation: Linux w/KVM Installation: Linux w/KVM
    11. 11. 1. Verify nested KVM capability 2. Download DevCloud-KVM package for Linux KVM 3. Extract archive
    12. 12. 4. Install networks
    13. 13. 5. Edit file devcloud-kvm.xml, change path for qcow2 image to match actual path on workstation 6. Register and start VM
    14. 14. Inside DevCloud-KVM ssh root@172.17.10.10 password : “password” Inside DevCloud-KVM ssh root@172.17.10.10 password : “password”
    15. 15. Installing CloudStack from SourceInstalling CloudStack from Source
    16. 16. Deploying A ZoneDeploying A Zone
    17. 17. NetworkNetwork
    18. 18. Key KVM Agent ClassesKey KVM Agent Classes ● LibvirtComputingResource – Primary handler of *Command classes ● VirtualRoutingResource – Handles Virtual Router programming *Command classes ● LibvirtVMDef – Handles putting together Libvirt XML for guests ● KVMStorageProcessor – Handles most storage related *Command classes ● StorageAdaptor – Interface for implementing a storage pool (agent-side storage plugins) ● VifDriver – Interface for implementing vm nic plug, unplug (network plugin) – Extend VifDriverBase ● LibvirtComputingResource – Primary handler of *Command classes ● VirtualRoutingResource – Handles Virtual Router programming *Command classes ● LibvirtVMDef – Handles putting together Libvirt XML for guests ● KVMStorageProcessor – Handles most storage related *Command classes ● StorageAdaptor – Interface for implementing a storage pool (agent-side storage plugins) ● VifDriver – Interface for implementing vm nic plug, unplug (network plugin) – Extend VifDriverBase
    19. 19. ResourcesResources ● https://cwiki.apache.org/confluence/display/CLOUDSTACK/DevClou ● https://cwiki.apache.org/confluence/display/CLOUDSTACK/Marvin+ ● http://marcus.mlsorensen.com/cloudstack-extras ● https://cwiki.apache.org/confluence/display/CLOUDSTACK/DevClou ● https://cwiki.apache.org/confluence/display/CLOUDSTACK/Marvin+ ● http://marcus.mlsorensen.com/cloudstack-extras

    ×