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.
...
...
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 VM TO will contain an additional field to contain the platform emulator name (i.e. the mapping value). This change is implemented in the TO since the resource layer cannot talk to the DB, and TO is the only way to communicate the mapping.
In addition, the snapshot commands use this mapping too. The commands sent to the agent will contain the corresponding mapping needed.
In case a mapping is not found, we let the hypervisor take the decision to error out or not.
Since the OS and mappings are soft-deleted (i.e., use the "removed" column as standardized by the DAO layer), it will conform to the user-view of mappings while the command is being executed.
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.
listOsMapping
| Code Block |
|---|
{"count"=>1, "guestosmapping"=>[{"id"=>"3ef8e918-aa14-11e3-9293-8674b42bba24", "hypervisor"=>"XenServer", "hypervisorversion"=>"default", "ostypeid"=>"35b4370e-aa14-11e3-9293-8674b42bba24", "osdisplayname"=>"CentOS 4.5 (32-bit)", "osnameforhypervisor"=>"CentOS 4.5 (32-bit)"}} |
addGuestOs
| Code Block |
|---|
{"accountid"=>"acc29016-a947-11e3-9293-8674b42bba24", "userid"=>"acc2dfe4-a947-11e3-9293-8674b42bba24", "cmd"=>"org.apache.cloudstack.api.command.admin.guest.AddGuestOsCmd", "jobstatus"=>1, "jobprocstatus"=>0, "jobresultcode"=>0, "jobresulttype"=>"object", "jobresult"=>{"ostype"=>{"id"=>"8c6eaca7-6bd5-4600-8524-62d66e4a1913", "oscategoryid"=>"abdbfeee-a947-11e3-9293-8674b42bba24", "description"=>"amoghtestasync"}}, "created"=>"2014-03-11T15:09:57-0700", "jobid"=>"fcad9481-9de2-4443-b456-b26a94acd9f2"} |
updateGuestOs
| Code Block |
|---|
{"accountid"=>"acc29016-a947-11e3-9293-8674b42bba24", "userid"=>"acc2dfe4-a947-11e3-9293-8674b42bba24", "cmd"=>"org.apache.cloudstack.api.command.admin.guest.UpdateGuestOsCmd", "jobstatus"=>1, "jobprocstatus"=>0, "jobresultcode"=>0, "jobresulttype"=>"object", "jobresult"=>{"ostype"=>{"id"=>"8c6eaca7-6bd5-4600-8524-62d66e4a1913", "oscategoryid"=>"abdbfeee-a947-11e3-9293-8674b42bba24", "description"=>"Windows XP SP2 (32-bitss)"}}, "created"=>"2014-03-11T15:11:09-0700", "jobid"=>"327c83a6-2af5-45bf-bbe2-b609762f42a8"} |
removeGuestOs
| Code Block |
|---|
{"accountid"=>"acc29016-a947-11e3-9293-8674b42bba24", "userid"=>"acc2dfe4-a947-11e3-9293-8674b42bba24", "cmd"=>"org.apache.cloudstack.api.command.admin.guest.RemoveGuestOsCmd", "jobstatus"=>1, "jobprocstatus"=>0, "jobresultcode"=>0, "jobresulttype"=>"object", "jobresult"=>{"success"=>true}, "created"=>"2014-03-11T15:11:36-0700", "jobid"=>"00baa71f-0af5-40f5-884a-b60a6af1224a"} |
addGuestOsMapping
| Code Block |
|---|
{"accountid"=>"acc29016-a947-11e3-9293-8674b42bba24", "userid"=>"acc2dfe4-a947-11e3-9293-8674b42bba24", "cmd"=>"org.apache.cloudstack.api.command.admin.guest.AddGuestOsMappingCmd", "jobstatus"=>1, "jobprocstatus"=>0, "jobresultcode"=>0, "jobresulttype"=>"object", "jobresult"=>{"guestosmapping"=>{"id"=>"73bd536f-a5ee-4a9a-b14d-5d9bc9040be8", "hypervisor"=>"KVM", "hypervisorversion"=>"default", "ostypeid"=>"abe1a236-a947-11e3-9293-8674b42bba24", "osdisplayname"=>"CentOS 6.4 (64-bit)", "osnameforhypervisor"=>"amoghtestxen"}}, "created"=>"2014-03-11T15:13:06-0700", "jobid"=>"b7e444de-f998-42a5-885c-861a200ea229"} |
updateGuestOsMapping
| Code Block |
|---|
{"accountid"=>"acc29016-a947-11e3-9293-8674b42bba24", "userid"=>"acc2dfe4-a947-11e3-9293-8674b42bba24", "cmd"=>"org.apache.cloudstack.api.command.admin.guest.UpdateGuestOsMappingCmd", "jobstatus"=>1, "jobprocstatus"=>0, "jobresultcode"=>0, "jobresulttype"=>"object", "jobresult"=>{"guestosmapping"=>{"id"=>"73bd536f-a5ee-4a9a-b14d-5d9bc9040be8", "hypervisor"=>"KVM", "hypervisorversion"=>"default", "ostypeid"=>"abe1a236-a947-11e3-9293-8674b42bba24", "osdisplayname"=>"CentOS 6.4 (64-bit)", "osnameforhypervisor"=>"amoghsname"}}, "created"=>"2014-03-11T15:14:51-0700", "jobid"=>"3abbcb0a-b9b4-46cf-aafd-bedc2b2f0399"} |
removeGuestOsMapping
| Code Block |
|---|
{"accountid"=>"acc29016-a947-11e3-9293-8674b42bba24", "userid"=>"acc2dfe4-a947-11e3-9293-8674b42bba24", "cmd"=>"org.apache.cloudstack.api.command.admin.guest.RemoveGuestOsMappingCmd", "jobstatus"=>1, "jobprocstatus"=>0, "jobresultcode"=>0, "jobresulttype"=>"object", "jobresult"=>{"success"=>true}, "created"=>"2014-03-11T15:16:06-0700", "jobid"=>"d38b54b6-fec4-4eef-b1df-e0112c87389f"} |
Schema shall be changed as :
| Code Block |
|---|
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 :
| Code Block |
|---|
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>
The dev mail thread is here :