vmss_config function

Virtual machine scaleset configuration functions

Virtual machine scaleset configuration functions

centos_7.5_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) centos_7.6_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) centos_8.1_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) debian_8_backports_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) debian_9_backports_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) debian_10_backports_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) debian_10_backports_gen2_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) ubuntu_dsvm_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh, nsg_rule_allow_jupyter, nsg_rule_allow_rstudio)), load_balancer = lb_config(rules = list(lb_rule_ssh, lb_rule_jupyter, lb_rule_rstudio), probes = list(lb_probe_ssh, lb_probe_jupyter, lb_probe_rstudio)), ...) ubuntu_dsvm_gen2_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh, nsg_rule_allow_jupyter, nsg_rule_allow_rstudio)), load_balancer = lb_config(rules = list(lb_rule_ssh, lb_rule_jupyter, lb_rule_rstudio), probes = list(lb_probe_ssh, lb_probe_jupyter, lb_probe_rstudio)), ...) windows_dsvm_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_rdp)), load_balancer = lb_config(rules = list(lb_rule_rdp), probes = list(lb_probe_rdp)), options = scaleset_options(keylogin = FALSE), ...) rhel_7.6_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) rhel_8_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) rhel_8.1_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) rhel_8.1_gen2_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) rhel_8.2_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) rhel_8.2_gen2_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) ubuntu_16.04_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) ubuntu_18.04_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) ubuntu_20.04_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) ubuntu_20.04_gen2_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_ssh)), load_balancer = lb_config(rules = list(lb_rule_ssh), probes = list(lb_probe_ssh)), ...) windows_2016_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_rdp)), load_balancer = lb_config(rules = list(lb_rule_rdp), probes = list(lb_probe_rdp)), options = scaleset_options(keylogin = FALSE), ...) windows_2019_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_rdp)), load_balancer = lb_config(rules = list(lb_rule_rdp), probes = list(lb_probe_rdp)), options = scaleset_options(keylogin = FALSE), ...) windows_2019_gen2_ss(datadisks = numeric(0), nsg = nsg_config(list(nsg_rule_allow_rdp)), load_balancer = lb_config(rules = list(lb_rule_rdp), probes = list(lb_probe_rdp)), options = scaleset_options(keylogin = FALSE), ...) vmss_config(image, options = scaleset_options(), datadisks = numeric(0), nsg = nsg_config(), vnet = vnet_config(), load_balancer = lb_config(), load_balancer_address = ip_config(), autoscaler = autoscaler_config(), other_resources = list(), variables = list(), ...)

Arguments

  • datadisks: The data disks to attach to the VM. Specify this as either a vector of numeric disk sizes in GB, or a list of datadisk_config objects for more control over the specification.
  • nsg: The network security group for the scaleset. Can be a call to nsg_config to create a new NSG; an AzureRMR resource object or resource ID to reuse an existing NSG; or NULL to not use an NSG (not recommended).
  • load_balancer: The load balancer for the scaleset. Can be a call to lb_config to create a new load balancer; an AzureRMR resource object or resource ID to reuse an existing load balancer; or NULL if load balancing is not required.
  • ...: For the specific VM configurations, other customisation arguments to be passed to vm_config. For vmss_config, named arguments that will be folded into the scaleset resource definition in the template.
  • options: Scaleset options, as obtained via a call to scaleset_options.
  • image: For vmss_config, the VM image to deploy. This should be an object of class image_config, created by the function of the same name.
  • vnet: The virtual network for the scaleset. Can be a call to vnet_config to create a new virtual network, or an AzureRMR resource object or resource ID to reuse an existing virtual network. Note that by default, AzureVM will associate the NSG with the virtual network/subnet, not with the VM's network interface.
  • load_balancer_address: The public IP address for the load balancer. Can be a call to ip_config to create a new IP address, or an AzureRMR resource object or resource ID to reuse an existing address resource. Ignored if load_balancer is NULL.
  • autoscaler: The autoscaler for the scaleset. Can be a call to autoscaler_config to create a new autoscaler; an AzureRMR resource object or resource ID to reuse an existing autoscaler; or NULL if autoscaling is not required.
  • other_resources: An optional list of other resources to include in the deployment.
  • variables: An optional named list of variables to add to the template.

Returns

An object of S3 class vmss_config, that can be used by the create_vm_scaleset method.

Details

These functions are for specifying the details of a new virtual machine scaleset deployment: the base VM image and related options, along with the Azure resources that the scaleset may need. These include the network security group, virtual network, load balancer and associated public IP address, and autoscaler.

Each resource can be specified in a number of ways:

  • To create a new resource as part of the deployment, call the corresponding *_config function.
  • To use an existing resource, supply either an AzureRMR::az_resource object (recommended) or a string containing the resource ID.
  • If the resource is not needed, specify it as NULL.
  • For the other_resources argument, supply a list of resources, each of which should be a list of resource fields (name, type, properties, sku, etc).

The vmss_config function is the base configuration function, and the others call it to create VM scalesets with specific operating systems and other image details.

  • ubuntu_dsvm_ss: Data Science Virtual Machine, based on Ubuntu 18.04
  • windows_dsvm_ss: Data Science Virtual Machine, based on Windows Server 2019
  • ubuntu_16.04_ss, ubuntu_18.04_ss, ubuntu_20.04_ss, ubuntu_20.04_gen2_ss: Ubuntu LTS
  • windows_2016_ss, windows_2019_ss: Windows Server Datacenter edition
  • rhel_7.6_ss, rhel_8_ss, rhel_8.1_ss, rhel_8.1_gen2_ss, rhel_8.2_ss, rhel_8.2_gen2_ss: Red Hat Enterprise Linux
  • centos_7.5_ss, centos_7.6_ss, centos_8.1_ss: CentOS
  • debian_8_backports_ss, debian_9_backports_ss, debian_10_backports_ss, debian_10_backports_gen2_ss: Debian with backports

The VM scaleset configurations with gen2 in the name use generation 2 VMs, which feature several technical improvements over the earlier generation 1. Consider using these for greater efficiency, however note that gen2 VMs are only available for select images and do not support all possible VM sizes.

A VM scaleset configuration defines the following template variables by default, depending on its resources. If a particular resource is created, the corresponding *Name, *Id and *Ref variables will be available. If a resource is referred to but not created, the *Name* and *Id variables will be available. Other variables can be defined via the variables argument.

Variable nameContentsDescription
location[resourceGroup().location]Region to deploy resources
vmId[resourceId('Microsoft.Compute/virtualMachines', parameters('vmName'))]VM scaleset resource ID
vmRef[concat('Microsoft.Compute/virtualMachines/', parameters('vmName'))]Scaleset template reference
nsgName[concat(parameters('vmName'), '-nsg')]Network security group resource name
nsgId[resourceId('Microsoft.Network/networkSecurityGroups',variables('nsgName'))]NSG resource ID
nsgRef[concat('Microsoft.Network/networkSecurityGroups/',variables('nsgName'))]NSG template reference
vnetName[concat(parameters('vmName'), '-vnet')]Virtual network resource name
vnetId[resourceId('Microsoft.Network/virtualNetworks',variables('vnetName'))]Vnet resource ID
vnetRef[concat('Microsoft.Network/virtualNetworks/', variables('vnetName'))]Vnet template reference
subnetsubnetSubnet name. Only defined if a Vnet was created or supplied as an az_resource object.
subnetId[concat(variables('vnetId'), '/subnets/', variables('subnet'))]Subnet resource ID. Only defined if a Vnet was created or supplied as an az_resource object.
lbName[concat(parameters('vmName'), '-lb')]Load balancer resource name
lbId[resourceId('Microsoft.Network/loadBalancers', variables('lbName'))]Load balancer resource ID
lbRef[concat('Microsoft.Network/loadBalancers/', variables('lbName'))]Load balancer template reference
lbFrontendNamefrontendLoad balancer frontend IP configuration name. Only defined if a load balancer was created or supplied as an az_resource object.
lbBackendNamebackendLoad balancer backend address pool name. Only defined if a load balancer was created or supplied as an az_resource object.
lbFrontendId[concat(variables('lbId'), '/frontendIPConfigurations/',variables('lbFrontendName'))]Load balancer frontend resource ID. Only defined if a load balancer was created or supplied as an az_resource object.
lbBackendId[concat(variables('lbId'), '/backendAddressPools/',variables('lbBackendName'))]Load balancer backend resource ID. Only defined if a load balancer was created or supplied as an az_resource object.
ipName[concat(parameters('vmName'), '-ip')]Public IP address resource name
ipId[resourceId('Microsoft.Network/publicIPAddresses',variables('ipName'))]IP resource ID
ipRef[concat('Microsoft.Network/publicIPAddresses/', variables('ipName'))]IP template reference
asName[concat(parameters('vmName'), '-as')]Autoscaler resource name
asId[resourceId('Microsoft.Insights/autoscaleSettings',variables('asName'))]Autoscaler resource ID
asRef[concat('Microsoft.Insights/autoscaleSettings/', variables('asName'))]Autoscaler template reference
asMaxCapacity[mul(int(parameters('instanceCount')), 10)]Maximum capacity for the autoscaler. Only defined if an autoscaler was created.
asScaleValue[max(div(int(parameters('instanceCount')), 5), 1)]Default capacity for the autoscaler. Only defined if an autoscaler was created.

Thus, for example, if you are creating a VM scaleset named "myvmss" along with all its associated resources, the NSG is named "myvmss-nsg", the virtual network is "myvmss-vnet", the load balancer is "myvmss-lb", the public IP address is "myvmss-ip", and the autoscaler is "myvm-as".

Examples

# basic Linux (Ubuntu) and Windows configs ubuntu_18.04_ss() windows_2019_ss() # Windows DSVM scaleset, no load balancer and autoscaler windows_dsvm_ss(load_balancer=NULL, autoscaler=NULL) # RHEL VM exposing ports 80 (HTTP) and 443 (HTTPS) rhel_8_ss(nsg=nsg_config(nsg_rule_allow_http, nsg_rule_allow_https)) # exposing no ports externally rhel_8_ss(nsg=nsg_config(list())) # low-priority (spot) VMs, large scaleset (>100 instances allowed), no managed identity rhel_8_ss(options=scaleset_options(priority="spot", large_scaleset=TRUE, managed_identity=FALSE)) ## Not run: # reusing existing resources: placing a scaleset in an existing vnet/subnet # we don't need a new network security group either vnet <- AzureRMR::get_azure_login()$ get_subscription("sub_id")$ get_resource_group("rgname")$ get_resource(type="Microsoft.Network/virtualNetworks", name="myvnet") ubuntu_18.04_ss(vnet=vnet, nsg=NULL) ## End(Not run)

See Also

scaleset_options for options relating to the scaleset resource itself

nsg_config , ip_config , vnet_config , lb_config , autoscaler_config for other resource configs

build_template for template builder methods

vm_config for configuring an individual virtual machine

create_vm_scaleset

  • Maintainer: Hong Ooi
  • License: MIT + file LICENSE
  • Last published: 2020-10-14