Forum Discussion

NoamRotter's avatar
NoamRotter
Icon for Altostratus rankAltostratus
Dec 01, 2019

AS3 add another VS to existing tenant

I have deployed the sample AS3 script to create a VS with pool and pool members from here:

 {
     "class": "AS3",
     "action": "deploy",
     "persist": true,
     "declaration": {
         "class": "ADC",
         "schemaVersion": "3.0.0",
         "id": "urn:uuid:33045210-3ab8-4636-9b2a-c98d22ab915d",
         "label": "Sample 1",
         "remark": "Simple HTTP Service with Round-Robin Load Balancing",
         "AS1": {
             "class": "Tenant",
             "A1": {
                 "class": "Application",
                 "template": "generic",
                 "MyVS1": {
                     "class": "Service_HTTP",
                     "virtualAddresses": [
                         "10.0.1.11"
                     ],
                     "pool": "web_pool_1"
                 },
                 "web_pool_1": {
                     "class": "Pool",
                     "monitors": [
                         "http"
                     ],
                     "members": [
                         {
                             "servicePort": 80,
                             "serverAddresses": [
                                 "192.0.1.10",
                                 "192.0.1.11"
                             ]
                         }
                     ]
                 }
             }
         }
     }
 }


Now I want to add another VS to the same tenant (same partition)

but when I edit the above script and deploy this:

   {
     "class": "AS3",
     "action": "deploy",
     "persist": true,
     "declaration": {
         "class": "ADC",
         "schemaVersion": "3.0.0",
         "id": "urn:uuid:33045210-3ab8-4636-9b2a-c98d22ab915d",
         "label": "Sample 1",
         "remark": "Simple HTTP Service with Round-Robin Load Balancing",
         "AS1": {
             "class": "Tenant",
             "A1": {
                 "class": "Application",
                 "template": "generic",
                 "MyVS2": {
                     "class": "Service_HTTP",
                     "virtualAddresses": [
                         "10.0.1.12"
                     ],
                     "pool": "web_pool_2"
                 },
                 "web_pool_2": {
                     "class": "Pool",
                     "monitors": [
                         "http"
                     ],
                     "members": [
                         {
                             "servicePort": 80,
                             "serverAddresses": [
                                 "192.0.1.12",
                                 "192.0.1.13"
                             ]
                         }
                     ]
                 }
             }
         }
     }
 }




It replaces the old configuration and I only have MyVS2.

How can I add MyVS2 to the current configuration without losing MyVS1?