DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.

DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
CloudStack currently does not allow an easy way to add new guest OS types, for example, a standard way to add say, CentOS 6.5.
Part of the reason is since the OS to hypervisor-specific platform mappings are currently hard-coded into the code-base (e.g : https://github.com/apache/cloudstack/blob/master/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMGuestOsMapper.java)
To support such new OS addition, the current way is to manipulate the DB using upgrade scripts and make the necessary code changes.
This proposal aims to partially mitigate this issue by allowing the CloudStack admin the ability to add new OS in the list, and update the mapping to hypervisor-specific platform names, via APIs / UI. For now, the admin will be responsible for providing the mapping to hypervisor-specific platform names based on his knowledge, which may be enhanced in future.
At the core, the mappings will be stored in a table in DB.The table guest_os_hypervisor may be reused for this purpose (it is not being used elsewhere)
To accommodate Xen specifics (mappings are version specific in some cases), the hypervisor version will be stored in the table too.
Additionally, a table will be needed to store the available platform emulators for a hypervisor.
The admin is responsible for passing the right mapping.
The APIs needed are :
The APIs will not allow for duplicate guest OS -> platform emulator mappings for a specific hypervisor.
All the APIs, other than list, shall be async APIs.
The APIs above are sufficient to implement a UI on top of this.
Schema shall be changed as :
ALTER TABLE `cloud`.`guest_os_hypervisor` ADD COLUMN `hypervisor_version` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Hypervisor version for this mapping';
ALTER TABLE `cloud`.`guest_os_hypervisor` ADD COLUMN `uuid` varchar(40) COMMENT 'UUID of the mapping';
ALTER TABLE `cloud`.`guest_os_hypervisor` ADD CONSTRAINT `uc_guest_os_hypervisor__uuid` UNIQUE (`uuid`);
ALTER TABLE `cloud`.`guest_os_hypervisor` ADD COLUMN `created` datetime COMMENT 'Time when mapping was created';
ALTER TABLE `cloud`.`guest_os_hypervisor` ADD COLUMN `removed` datetime COMMENT 'Time when mapping was removed if deleted, else NULL';
UPDATE `cloud`.`guest_os_hypervisor` SET `uuid` = UUID();
UPDATE `cloud`.`guest_os_hypervisor` SET `created` = now();
GUEST_OS table changes :
ALTER TABLE `cloud`.`guest_os` ADD COLUMN `created` datetime COMMENT 'Time when Guest OS was created in system';
ALTER TABLE `cloud`.`guest_os` ADD COLUMN `removed` datetime COMMENT 'Time when Guest OS was removed if deleted, else NULL';
UPDATE `cloud`.`guest_os` SET `created` = now();
The ResourceBase / OsMapper files will load the mappings from DB, via the respective Gurus.
<Additional details and sequence diagram here>