diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 18eb97706f..289675d4e0 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -404,24 +404,6 @@ VM_MAD = [ # -t: number of threads, i.e. number of transfers made at the same time # -d: list of transfer drivers separated by commas, if not defined all the # drivers available will be enabled -# -# The configuration for each driver is defined in TM_MAD_CONF. These -# values are used when creating a new datastore and should not be modified -# since they define the datastore behaviour. -# name : name of the transfer driver, listed in the -d option of the -# TM_MAD section -# ln_target : determines how the persistent images will be cloned when -# a new VM is instantiated. -# NONE: The image will be linked and no more storage capacity will be used -# SELF: The image will be cloned in the Images datastore -# SYSTEM: The image will be cloned in the System datastore -# clone_target : determines how the non persistent images will be -# cloned when a new VM is instantiated. -# NONE: The image will be linked and no more storage capacity will be used -# SELF: The image will be cloned in the Images datastore -# SYSTEM: The image will be cloned in the System datastore -# shared : determines if the storage holding the system datastore is shared -# among the different hosts or not. Valid values: "yes" or "no" #******************************************************************************* TM_MAD = [ @@ -429,62 +411,6 @@ TM_MAD = [ arguments = "-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,ceph" ] -TM_MAD_CONF = [ - name = "dummy", - ln_target = "NONE", - clone_target= "SYSTEM", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "lvm", - ln_target = "NONE", - clone_target= "SELF", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "shared", - ln_target = "NONE", - clone_target= "SYSTEM", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "fs_lvm", - ln_target = "SYSTEM", - clone_target= "SYSTEM", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "qcow2", - ln_target = "NONE", - clone_target= "SYSTEM", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "ssh", - ln_target = "SYSTEM", - clone_target= "SYSTEM", - shared = "no" -] - -TM_MAD_CONF = [ - name = "vmfs", - ln_target = "NONE", - clone_target= "SYSTEM", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "ceph", - ln_target = "NONE", - clone_target= "SELF", - shared = "yes" -] - #******************************************************************************* # Datastore Driver Configuration #******************************************************************************* @@ -686,6 +612,15 @@ SESSION_EXPIRATION_TIME = 900 DEFAULT_UMASK = 177 +#******************************************************************************* +# OneGate +# ONEGATE_ENDPOINT: The URL for the onegate server (the Gate to OpenNebula for +# VMs). The onegate server is started using a separate command. The endpoint +# MUST be consistent with the values in onegate-server.conf +#******************************************************************************* + +#ONEGATE_ENDPOINT = "http://frontend:5030" + #******************************************************************************* # Restricted Attributes Configuration #******************************************************************************* @@ -704,12 +639,6 @@ VM_RESTRICTED_ATTR = "NIC/BRIDGE" IMAGE_RESTRICTED_ATTR = "SOURCE" -#******************************************************************************* -# OneGate -#******************************************************************************* - -#ONEGATE_ENDPOINT = "http://frontend:5030" - #******************************************************************************* # Inherited Attributes Configuration #******************************************************************************* @@ -735,4 +664,61 @@ INHERIT_DATASTORE_ATTR = "CEPH_HOST" INHERIT_DATASTORE_ATTR = "CEPH_SECRET" INHERIT_DATASTORE_ATTR = "CEPH_USER" +INHERIT_DATASTORE_ATTR = "GLUSTER_HOST" +INHERIT_DATASTORE_ATTR = "GLUSTER_VOLUME" + INHERIT_VNET_ATTR = "VLAN_TAGGED_ID" + +#******************************************************************************* +# Transfer Manager Driver Behavior Configuration +#******************************************************************************* +# The configuration for each driver is defined in TM_MAD_CONF. These +# values are used when creating a new datastore and should not be modified +# since they define the datastore behavior. +# name : name of the transfer driver, listed in the -d option of the +# TM_MAD section +# ln_target : determines how the persistent images will be cloned when +# a new VM is instantiated. +# NONE: The image will be linked and no more storage capacity will be used +# SELF: The image will be cloned in the Images datastore +# SYSTEM: The image will be cloned in the System datastore +# clone_target : determines how the non persistent images will be +# cloned when a new VM is instantiated. +# NONE: The image will be linked and no more storage capacity will be used +# SELF: The image will be cloned in the Images datastore +# SYSTEM: The image will be cloned in the System datastore +# shared : determines if the storage holding the system datastore is shared +# among the different hosts or not. Valid values: "yes" or "no" +#******************************************************************************* + +TM_MAD_CONF = [ + name = "dummy", ln_target = "NONE", clone_target = "SYSTEM", shared = "yes" +] + +TM_MAD_CONF = [ + name = "lvm", ln_target = "NONE", clone_target = "SELF", shared = "yes" +] + +TM_MAD_CONF = [ + name = "shared", ln_target = "NONE", clone_target = "SYSTEM", shared = "yes" +] + +TM_MAD_CONF = [ + name = "fs_lvm", ln_target = "SYSTEM", clone_target = "SYSTEM", shared="yes" +] + +TM_MAD_CONF = [ + name = "qcow2", ln_target = "NONE", clone_target = "SYSTEM", shared = "yes" +] + +TM_MAD_CONF = [ + name = "ssh", ln_target = "SYSTEM", clone_target = "SYSTEM", shared = "no" +] + +TM_MAD_CONF = [ + name = "vmfs", ln_target = "NONE", clone_target= "SYSTEM", shared = "yes" +] + +TM_MAD_CONF = [ + name = "ceph", ln_target = "NONE", clone_target = "SELF", shared = "yes" +] diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index 93e01caa85..65b2ff9aae 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -24,6 +24,56 @@ const float LibVirtDriver::CGROUP_BASE_CPU_SHARES = 1024; +/** + * This function generates the element for network disks + */ +static void do_network_hosts(ofstream& file, + const string& cg_host, + const string& transport) +{ + if (cg_host.empty()) + { + file << "'/>" << endl; + return; + } + + vector::const_iterator it; + vector hosts; + + hosts = one_util::split(cg_host, ' '); + + file << "'>" << endl; + + for (it = hosts.begin(); it != hosts.end(); it++) + { + vector parts = one_util::split(*it, ':'); + + if (parts.empty()) + { + continue; + } + + file << "\t\t\t\t" << endl; + } + + file << "\t\t\t" << endl; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + int LibVirtDriver::deployment_description_kvm( const VirtualMachine * vm, const string& file_name) const @@ -64,6 +114,8 @@ int LibVirtDriver::deployment_description_kvm( string ceph_host = ""; string ceph_secret= ""; string ceph_user = ""; + string gluster_host = ""; + string gluster_volume = ""; int disk_id; string default_driver = ""; @@ -331,6 +383,8 @@ int LibVirtDriver::deployment_description_kvm( ceph_host = disk->vector_value("CEPH_HOST"); ceph_secret = disk->vector_value("CEPH_SECRET"); ceph_user = disk->vector_value("CEPH_USER"); + gluster_host = disk->vector_value("GLUSTER_HOST"); + gluster_volume = disk->vector_value("GLUSTER_VOLUME"); disk->vector_value_str("DISK_ID", disk_id); @@ -379,38 +433,7 @@ int LibVirtDriver::deployment_description_kvm( file << "-" << vm->get_oid() << "-" << disk_id; } - if ( ceph_host.empty() ) - { - file << "'/>" << endl; - } - else - { - vector::const_iterator it; - vector hosts = one_util::split(ceph_host, ' '); - - file << "'>" << endl; - - for (it = hosts.begin(); it != hosts.end(); it++) - { - vector parts = one_util::split(*it, ':'); - - if (parts.empty()) - { - continue; - } - - file << "\t\t\t\t" << endl; - } - - file << "\t\t\t" << endl; - } + do_network_hosts(file, ceph_host, ""); if ( !ceph_secret.empty() && !ceph_user.empty()) { @@ -420,6 +443,31 @@ int LibVirtDriver::deployment_description_kvm( << "\t\t\t" << endl; } } + else if ( type == "GLUSTER" || type == "GLUSTER_CDROM" ) + { + if ( type == "GLUSTER" ) + { + file << "\t\t" << endl; + } + else + { + file << "\t\t" << endl; + } + + file << "\t\t\t" << endl