Please read
http://sourceforge.net/mailarchive/message.php?msg_id=28028656
http://wiki.openvz.org/Main_Page
especially this bit:
Hi Andrew,
In general, to support a new hypervisor, need to add the
following into cloudstack:
1. The template: the VM is created from a template, usually, each
hypervisor has its own template format(VMDK/VHD/QCOW2, etc).
There are two default templates preinstalled in the
database: one for system VM and one for user VM(see code
setup/db/templates.sql). Users can upload their own templates into
cloudstack through UI or API also.
Templates are downloaded into secondary storage by secondary
storage VM(NfsSecondaryStorageResource).
Note for OpenVZ, as the template for OpenVZ is a bunch of
files, not a single image as other hypervisors did, need to tell the
download manager don't unzip/untar the template for OpenVZ.
2. The host: Cloudstack management server needs a way to talk to
each host, so to create VM, gather statistics of VM/cpu/memory etc.
There is a discover for each hypervisor, e.g.
KvmServerDiscover, which connects to kvm host through ssh, configure
kvm host and launch an agent which connect back to management server.
A number of hosts can be grouped together as a cluster. In a
cluster, hosts must be the same hypervisor.
Note for OpenVZ, can reuse the same kvm discover.
3. The storage: there are primary storage/secondary storage: VM's
disk is put into primary storage, which can be shared(NFS/Gluster etc)
or local file system. The snapshot/iso/template are put into secondary
storage, which is NFS.
The shared primary storage is per cluster, so every time, a new
host added into a cluster, management server will send a command,
called ModifyStoragePoolCommand or CreateStoragePoolCommand, to the
host, so the host can mount the primary storage accordingly.
The local primary storage is per host, it's reported to
management server when adding the host, e.g. by default, kvm agent
will report "/var/lib/libvirt/images" as the local storage.
Note for OpenVZ, can OpenVZ support shared storage? AFAIK,
the root disk of a OpenVZ VM is just a folder, and I don't find the
way to specify the folder. And at least from
http://pve.proxmox.com/wiki/Storage_Model, there is no shared storage
for OpenVZ. So basically, only local storage supported.
4. The VM:
volume: Before starting the VM, management server will send
CreateCommand to host to create a volume on primary storage.
nic: Level 2 bridge, it can be tagged VLAN or untagged. The
nic information is send in the StartCommand, hypervisor needs to
prepare the nic accordingly, before starting VM.
cpu/memory: management server will send this information in
the StartCommand.
Note for OpenVZ, don't need to create a volume for a VM, so in
the CreateCommand, need to return a fake volume to management server.
I think it's pretty straightforward to add OpenVZ into CloudStack,
we can reuse current KVM stuff, use libvirt to create OpenVZ vm, and
use vz** tools to configure VM if needed.
Most of the KVM hypervisor code is in the
LibvirtComputingResource, you can modify the code as said above.
Paul
--
Paul Fremantle
CTO and Co-Founder, WSO2
OASIS WS-RX TC Co-chair, VP, Apache Synapse
UK: +44 207 096 0336
US: +1 646 595 7614
blog: http://pzf.fremantle.org
twitter.com/pzfreo
[email protected]
wso2.com Lean Enterprise Middleware
Disclaimer: This communication may contain privileged or other confidential
information and is intended exclusively for the addressee/s. If you are not
the intended recipient/s, or believe that you may have received this
communication in error, please reply to the sender indicating that fact and
delete the copy you received and in addition, you should not print, copy,
retransmit, disseminate, or otherwise use the information contained in this
communication. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev