Catalog creation for multi vCenter provision

Hello,
In my environment i have two vCenter each configured with respective datacenter DC1 & DC2 and NSX-T network provider respective to each vCenter.

I am trying to create a catalog where in input form if user choose DC1, vm should get deploy in DC1, whereas if user choose DC2 then vm should deploy in DC2.
I have made the virtual images availability in both vcenter as per morpheus guide.

In actual when i create catalogue using configure wizard, if i create it using DC1, it works for DC1 provisioning only and if i choose DC2, it get failed at vm deploy phase.

It seems i am missing to use some variables or unable to map properly.

Please guide on this. If anyone have reference catalogue config script, please share.

Can you give us some more information about the configuration? Which inputs are you using in your form? How is the json from the catalog configured?

Hi @rkjha,

If all you are asking of the user is which DC, you’ll have to add logic within the Catalog Configuration to handle setting the other values properly.

For example, Networks are targeted with ID. If you select ‘Servers’ Network in DC1, the ID won’t match ‘Servers’ Network in DC2 (assuming not a stretched cluster).

So assuming your current network block in the configuration looks like:

"networkInterfaces": [
    {
      "ipMode": "",
      "primaryInterface": true,
      "showNetworkPoolLabel": true,
      "showNetworkDhcpLabel": false,
      "network": {
        "idName": "Servers",
        "pool": {
          "name": "192.168.10.0/24",
          "id": 30
        },
        "id": "network-29057",
        "hasPool": false
      }
    }
  ],

You would update it to something like:

"networkInterfaces": [
    {
      "ipMode": "",
      "primaryInterface": true,
      "showNetworkPoolLabel": true,
      "showNetworkDhcpLabel": false,
      "network": {
        "idName": "Servers",
        "pool": {
          "name": "192.168.10.0/24",
          "id": 30
        },
        "id": "<%= customOptions?.dcSelector == 'dc1' ? 'network-29057' : 'network-123456' %>",
        "hasPool": false
      }
    }
  ],

Essentially doing a ternary (if statement) based off of the value of your DC option list. Also, you usually only have to update IDs, but sometimes other values may be pertinent as well.