Modify a virtual appliance
List the virtual appliances available to modify
The first step in modifying a virtual appliance is to retrieve a list of available virtual appliances. This can be done by either retrieving all known virtual appliances or by retrieving a list of virtual appliances that exists on an image repository. This example retrieves all virtual appliances. Select the appropriate virtual appliances from the list and save the value of its OID property. This value can be used in the subsequent requests.
- URL
- https://myserver:port/{webContext}/VMControl/virtualAppliances
- HTTP method
- GET
- Sample request
Get the list of all virtual appliances:
GET https://myserver:port/{webContext}/VMControl/virtualAppliances
Listing 14. Sample response representation{ "candidates": { "uri": "/ibm/director/rest/VMControl/virtualAppliances/candidates" }, "virtualAppliances": [ { "properties": {}, "oid": 28912, "name": "Virtual Appliance 1", "uri": "/ibm/director/rest/VMControl/virtualAppliances/28912" }, { "properties": {}, "oid": 29731, "name": "cap_nim", "uri": "/ibm/director/rest/VMControl/virtualAppliances/29731" }, { "properties": {}, "oid": 20495, "name": "cap_nim_aixmobb", "uri": "/ibm/director/rest/VMControl/virtualAppliances/20495" } ], "uri": "/ibm/director/rest/VMControl/virtualAppliances" }
Retrieve the OVF descriptor file for the virtual appliance
You can choose your virtual appliance and fetch the OVF descriptor file currently defined for the virtual appliance that needs to be updated. Using the virtual appliance OID from the previous step, create a GET request to the URL specified below.
It is recommended that you specify the Accept-Charset HTTP header to retrieve the OVF file in the format in which it was imported. If Accept-Charset is not specified, VMControl attempts to retrieve it in the UTF-8 format.
- URL
- https://myserver:port/{webContext}/VMControl/virtualAppliances/{virtualApplianceOID}.ovf
- HTTP method
- GET
- Sample request
Get the OVF descriptor file of virtual appliance 28912:
GET https://myserver:port/{webContext}/VMControl/virtualAppliances/28912.ovf
- Sample response representation
The actual OVF file.
- Sample response representation
Finally, it is time to create the modify virtual appliance request. Modify the OVF descriptor file that was retrieved from the previous step to add or remove information. Pass it in as the request body of your PUT request, specifying application/ovf+xml for your Content-Type HTTP header.
Note: VMControl will only validate whether the OVF file is syntactically correct. It is the responsibility of the developer to ensure that the OVF file will allow for the image to be deployed successfully.
The response contains the status of the modify virtual appliance request, including error messages.
- URL
- https://myserver:port/{webContext}/VMControl/virtualAppliances/{virtualApplianceOID}
- HTTP method
- PUT
- Sample request
Modify the virtual appliance with a unique ID of 28912:
PUT https://myserver:port/{webContext}/VMControl/virtualAppliances/28912
- Sample request representation
The updated OVF XML and the Content-Type should be application/ovf+xml
Listing 15. Sample responseStatus Code: 200 OK Accept-Ranges: bytes Cache-Control: no-store Content-Language: en-US Content-Length: 966 Content-Type: application/json; charset=UTF-8 Date: Wed, 11 Jul 2012 12:24:21 GMT Server: Noelios-Restlet-Engine/1.1.4 { "MessageID": "DNZEMW440E", "MessageText": "DNZEMW440E Update OVF request for virtual appliance: \"28912\" succeeded." }
- Sample request representation







