Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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.

API

The APIs needed are :

  1. Create new guest os type
    1. oscategory is required
    2. display name is required. Display names are unique
    3. name is optional (defaults to NULL)
  2. Modify guest os type
    1. UUID of guest os to modify is required
    2. display name is required. Display name should be unique
  3. Remove guest os type. It is a soft delete.
    1. UUID is required
  4. List all mappings
    1. hypervisor as parameter. Not mandatory. This will list all mappings for given hypervisor
    2. hypervisor version as parameter. Not mandatory. This is used in conjunction with hypervisor
  5. Add new mapping. Does not allow duplicate mappings
    1. hypervisor, hypervisor version, guest OS id and platform emulator name as parameters
  6. Remove existing mapping. This is a soft delete
    1. UUID of mapping is required
  7. Modify existing mapping
    1. UUID is required
    2. hypervisor specific name is required.

...

The APIs above are sufficient to implement a UI on top of this.

Sample responses

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"}

 

DB Schema

Schema shall be changed as :

...