VMware Cloud Community
Larch
Contributor
Contributor

vCenter REST API - deploy from ovf template

Hello everyone

I am trying to deploy from an ovf template. The following body with the "/com/vmware/vcenter/ovf/library-item/id:{ovf_library_item_id}?~action=deploy" function is already working.

{

    "deployment_spec": {

        "accept_all_EULA": true,

        "default_datastore_id": "datastore-30598",

        "network_mappings": [

        {

            "key": "4000",

            "value": "network-154"

        }

    ],

        "name": "AATest08"

    },

    "target": {

        "folder_id": "group-v5920",

        "host_id": "host-1934",

        "resource_pool_id": "resgroup-43"

    }

}

My problem is, that the network parameters (marked in red) are getting completly ignored. How can i fix that? What am i doing wrong?

Sadly, i cant find any examples on the web. I hope you guys can help me out.

Michael

Reply
0 Kudos
5 Replies
vmrale
Expert
Expert

Hi,

did You check if this Port Group related with MOiD "network-154" exists on a host?

Regards
Radek

If you think your question have been answered correctly, please consider marking it as a solution or rewarding me with kudos.
Reply
0 Kudos
Larch
Contributor
Contributor

Hi vmrale

Thank you for the response.

Yes the Network-154 is in the Port-Group of the Host i used to depoy the template.

I will contact the vmWare support and post the solution here.

Reply
0 Kudos
avseelam
Contributor
Contributor

Hi

Do you have any response from VMware. I am having similar issue while deploying library item from API

Reply
0 Kudos
Larch
Contributor
Contributor

I dont have any response. But my workaround is to change the network after the deployment.

Helpf for changing the network of an existing VM: REST API - update_spec

Reply
0 Kudos
avseelam
Contributor
Contributor

update the key to original portgroup name of library item instead of 4000. That did the trick however I cannot use the same code in vRO as it is throwing Java map errors

Reply
0 Kudos