16623: Add NetworkResourceGroup option for Azure
authorPeter Amstutz <peter.amstutz@curii.com>
Wed, 22 Jul 2020 18:58:59 +0000 (14:58 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Wed, 22 Jul 2020 20:31:34 +0000 (16:31 -0400)
refs #16623

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

lib/cloud/azure/azure.go
lib/config/config.default.yml
lib/config/generated_config.go

index 752de152da96a2dd7895a770ebd142b3139f5ffe..6de367aa251c4c034b77331befde540782dc89d5 100644 (file)
@@ -43,6 +43,7 @@ type azureInstanceSetConfig struct {
        ResourceGroup                string
        Location                     string
        Network                      string
+       NetworkResourceGroup         string
        Subnet                       string
        StorageAccount               string
        BlobContainer                string
@@ -356,6 +357,11 @@ func (az *azureInstanceSet) Create(
        }
        tags["created-at"] = to.StringPtr(time.Now().Format(time.RFC3339Nano))
 
+       networkResourceGroup := az.azconfig.NetworkResourceGroup
+       if networkResourceGroup == "" {
+               networkResourceGroup = az.azconfig.ResourceGroup
+       }
+
        nicParameters := network.Interface{
                Location: &az.azconfig.Location,
                Tags:     tags,
@@ -368,7 +374,7 @@ func (az *azureInstanceSet) Create(
                                                        ID: to.StringPtr(fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers"+
                                                                "/Microsoft.Network/virtualnetworks/%s/subnets/%s",
                                                                az.azconfig.SubscriptionID,
-                                                               az.azconfig.ResourceGroup,
+                                                               networkResourceGroup,
                                                                az.azconfig.Network,
                                                                az.azconfig.Subnet)),
                                                },
index 907acdc87847f9c052aee71c5e1d1fbe8c4f78aa..96291a2d4b9bdd2a7ce3341feb9c0e8254cc4879 100644 (file)
@@ -1008,13 +1008,29 @@ Clusters:
 
           # (azure) Instance configuration.
           CloudEnvironment: AzurePublicCloud
-          ResourceGroup: ""
           Location: centralus
+
+          # (azure) The resource group where the VM and virtual NIC will be
+          # created.
+          ResourceGroup: ""
+
+          # (azure) The resource group of the Network to use for the virtual
+          # NIC (if different from ResourceGroup)
+          NetworkResourceGroup: ""
           Network: ""
           Subnet: ""
+
+          # (azure) Where to store the VM VHD blobs
           StorageAccount: ""
           BlobContainer: ""
+
+          # (azure) How long to wait before deleting VHD and NIC
+          # objects that are no longer being used.
           DeleteDanglingResourcesAfter: 20s
+
+          # Account (that already exists in the VM image) that will be
+          # set up with an ssh authorized key to allow the compute
+          # dispatcher to connect.
           AdminUsername: arvados
 
     InstanceTypes:
index 96da19dfcdc14c6e20f0d1ea348c2423f909b1ba..2790477e4a9c46da6d6c859334b834e5ea888690 100644 (file)
@@ -1014,13 +1014,29 @@ Clusters:
 
           # (azure) Instance configuration.
           CloudEnvironment: AzurePublicCloud
-          ResourceGroup: ""
           Location: centralus
+
+          # (azure) The resource group where the VM and virtual NIC will be
+          # created.
+          ResourceGroup: ""
+
+          # (azure) The resource group of the Network to use for the virtual
+          # NIC (if different from ResourceGroup)
+          NetworkResourceGroup: ""
           Network: ""
           Subnet: ""
+
+          # (azure) Where to store the VM VHD blobs
           StorageAccount: ""
           BlobContainer: ""
+
+          # (azure) How long to wait before deleting VHD and NIC
+          # objects that are no longer being used.
           DeleteDanglingResourcesAfter: 20s
+
+          # Account (that already exists in the VM image) that will be
+          # set up with an ssh authorized key to allow the compute
+          # dispatcher to connect.
           AdminUsername: arvados
 
     InstanceTypes: