Paris75
Contributor
Contributor

REST API deploy ovf with additional parameters

Hi everyone,

I would like to deploy and customize a VM with the vsphere 6.5 REST api.

The following uri works fine to deploy a vm without customization.

  POST https://myserver/rest/com/vmware/vcenter/ovf/library-item/id:6fbf5ec7-9954-4580-82ee?~action=deploy

BODY { "deployment_spec": {      "accept_all_EULA": true,

                                 "default_datastore_id": "datastore-334",

                                 "name": "deploytest1",

                                 "storage_provisioning": "thin" },

       "target": { "folder_id": "group-v881",

                    "resource_pool_id":

                    "resgroup-578" }}

I would like to customize networks settings and domain. The following body structure does not work, what am I missing for?

BODY{ "deployment_spec": {      "accept_all_EULA": true,

                                "default_datastore_id": "datastore-334",

                                "name": "deployvm1",

                                "storage_provisioning": "eagerZeroedThick",

                                "network_mappings": [ { "key": "network01",

                                                        "value": "network-899" } ],

                                "additional_parameters": [ { "@class": "com.vmware.vcenter.ovf.property_params",

                                                             "properties": [ { "instance_id": "",

                                                                               "class_id": "",

                                                                               "description": "The gateway IP for this virtual appliance.",

                                                                               "id": "gateway",

                                                                               "label": "Default Gateway Address",

                                                                               "category": "LAN",

                                                                               "type": "ip",

                                                                               "value": "10.1.2.1" },],

       "target": { "folder_id": "group-v881",

                    "resource_pool_id":

                    "resgroup-578" }}

}

I am looking for an exemple to deploy and customize this ovf.

Thanks

0 Kudos
1 Reply
avseelam
Contributor
Contributor

did you had any breakthrough ? I was looking for some thing similar..

0 Kudos