08448380779 Call Girls In Greater Kailash - I Women Seeking Men
How to add a new hypervisor to CloudStack - Lessons learned from Hyper-V effort
1. How to add a new hypervisor to
CloudStack:
Lessons learned from Hyper-V
effort
Donal Lafferty
Friday, 15 November 2013
2. Summary
• Extend CloudStack with Plug-ins
• Include ServerResource for device access
• Lessons:
•
•
•
•
•
•
•
HTTPRequest lets you escape Java
Serialise JSON objects, not ported Java classes
TDD: write you code against tests
Automate with CloudMonkey
Adapt existing plug-ins
QuickCloud instead of System VMs
Plan to avoid proprietary tools & libs
3. Background: Extend CloudStack with
Plug-ins
• Java centric
• Plug-ins are distributed
(e.g. cloud-plugin-hypervisor-hyperv-4.3.0.jar)
(e.g. Discoverer)
• .jar
• Modules are loaded
• Spring config + class loader
• Extensions implement
• .class file implementing
interface
(e.g. Compute)
4. Background: ServerResource for Device
Access
• ServerResource
• Steps around Javas limits
Discoverer Module
Extension: Discoverer
- Brings resource under CloudStack control
• Two Agent types
• implemented directly by
the ServerResource
• E.g. XAPI calls
• running remotely,
connected to mgmt server
• E.g. KVM Agent
ServerResource
- Provides a communication layer in the form of an Agent
Connected Agent
Direct Connect Agent
CloudStack Message Bus
Device-specific
Connection
Remote CloudStack Agent
Extensible API
5. Problem: Create Plug-in for Hyper-V
Support
• VM lifecycle
• Avoid intermediaries
• CIFS for primary & secondary storage
• Analogous to NFS
• Hyper-V is SMB centric
• Advanced networking (ideally)
• Esp. VLANs for tenant isolation
• Console access (ideally)
6. Solution: Remote agent
Phase 1 – Connected Agent
Hyper-V API
(Python)
Server Resource
(Java)
Message Bus Agent
(Java - NIO)
AgentShell
(Windows Service)
Mgmt Server
(AgentManager)
Custom
TCP/JSON
7. Lesson: HTTPRequest lets you escape Java
Phase 2 – Direct Connect Agent
Hyper-V API
(WMI)
Server Resource
(C# - ASP.NET MVC4)
Web Server
(C# - not IIS)
AgentShell
(C# - Windows Service)
Mgmt Server
(Direct Connect Agent)
JSON over
HTTP
10. Lesson: Automate with CloudMonkey
cloudmonkey api createZone networktype="Advanced" securitygroupenabled="false" guestcidraddress="10.1.1.0/24“
name="HybridZone" localstorageenabled="true" dns1="4.4.4.4" internaldns1="10.70.176.118“
internaldns2="10.70.160.66"
…
apirequest=cloudmonkey api addSecondaryStorage zoneid=$zone
url="cifs://10.70.176.4/secondary?user=administrator&password=1pass%40word1"
cacheid=echo $apiresult | sed -e s/^.*"id": //; s/,.*$//
…
apiresult=cloudmonkey api addHost zoneid=$zone podid=$pod url="http://10.70.176.4" password="1pass@word1“
username="root" hypervisor="Hyperv" clusterid=$cluster
hostid=echo $apiresult | sed -e s/^.*"id": //; s/,.*$//
…
apiresult=cloudmonkey api listNetworkOfferings name="QuickCloudNoServices"
qcNetOffId=echo $apiresult | sed -e s/^.*"id": //; s/,.*$//
cloudmonkey api createNetwork zoneid=$zone networkofferingid=$qcNetOffId physicalnetworkid=$physnetid
name="QuickCloudNetName" displaytext="QuickCloudNetDesc" vlan=untagged acltype=domain gateway="10.70.176.1"
netmask="255.255.240.0" startip="10.70.176.124" endip="10.70.176.144"
11. Lesson: Adapt existing plug-ins
• Add CIFS support to NFS plug-in
• Similar workflow
• Mount, use local file system operations
• Can be specified in similar format
• cifs://192.168.1.128/CSHV3?user=root+password=1pass%40word1
• nfs://192.168.1.128/CSHV3
• Avoid scope creep…
“While you’re at Ikea for some towels, could you pick me up a couch?”
– unnamed flatmate
12. Lesson: QuickCloud instead of System
VMs
• System VMs
Virtual
Router VM
CloudStack
Mgmt Server
Console VM
• VM application
• Offload cloud services
• 3 kinds
• Hypervisor specific
• Esp boot args!
• QuickCloud alternative:
Secondary
Storage VM
• Daemon for Secondary Storage
Service
• QuickCloudNoServices network
• No console VM
13. Lesson: Plan to avoid proprietary tools &
libs
• Provide opensource build
• Mono
• Donation process takes time
• Proposal
• Vote
• Post source on Review Board
• SGA
14. Summary
• Extend CloudStack with Plug-ins
• Include ServerResource for device access
• Lessons:
•
•
•
•
•
•
•
HTTPRequest lets you escape Java
Serialise JSON objects, not ported Java classes
TDD: write your code against tests
Automate with CloudMonkey
Adapt existing plug-ins
QuickCloud instead of System VMs
Plan to avoid proprietary tools & libs