diff --git a/include/Image.h b/include/Image.h index 0b540b76e9..ec48664bd6 100644 --- a/include/Image.h +++ b/include/Image.h @@ -75,10 +75,12 @@ public: */ enum DiskType { - FILE = 0, /** < File-based disk */ - CD_ROM = 1, /** < An ISO9660 disk */ - BLOCK = 2, /** < Block-device disk */ - RBD = 3 /** < CEPH RBD disk */ + FILE = 0, /** < File-based disk */ + CD_ROM = 1, /** < An ISO9660 disk */ + BLOCK = 2, /** < Block-device disk */ + RBD = 3, /** < CEPH RBD disk */ + RBD_CDROM = 4, /** < CEPH RBD CDROM disk */ + GLUSTER = 5 /** < Gluster Block Device */ }; /** @@ -90,11 +92,13 @@ public: { switch (ob) { - case FILE: return "FILE" ; break; - case CD_ROM: return "CDROM" ; break; - case BLOCK: return "BLOCK" ; break; - case RBD: return "RBD" ; break; - default: return ""; + case FILE: return "FILE" ; break; + case CD_ROM: return "CDROM" ; break; + case BLOCK: return "BLOCK" ; break; + case RBD: return "RBD" ; break; + case RBD_CDROM: return "RBD_CDROM" ; break; + case GLUSTER: return "GLUSTER" ; break; + default: return ""; } }; diff --git a/src/image/Image.cc b/src/image/Image.cc index cdb8bf4ce6..a67f081c18 100644 --- a/src/image/Image.cc +++ b/src/image/Image.cc @@ -571,16 +571,27 @@ int Image::disk_attribute( VectorAttribute * disk, { case OS: case DATABLOCK: - case RBD: //Type is FILE or BLOCK as inherited from the DS disk_attr_type = disk_type_to_str(disk_type); - break; + break; case CDROM: //Always use CDROM type for these ones - disk_attr_type = "CDROM"; - break; + DiskType new_disk_type; + + switch(disk_type) + { + case RBD: + new_disk_type = RBD_CDROM; + break; + + default: + new_disk_type = CD_ROM; + } + + disk_attr_type = disk_type_to_str(new_disk_type); + break; default: //Other file types should not be never a DISK - break; + break; } disk->replace("TYPE", disk_attr_type); diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index 29bbf22927..9db9f2bcdc 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -362,6 +362,19 @@ int LibVirtDriver::deployment_description_kvm( file << "'/>" << endl; } + else if ( type == "RBD_CDROM" ) + { + file << "\t\t" << endl + << "\t\t\t" << endl; + } else if ( type == "CDROM" ) { file << "\t\t" << endl