Description Usage Arguments Details Value See Also Examples
Virtual machine scaleset configuration functions
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 |
nsg |
The network security group for the scaleset. Can be a call to |
load_balancer |
The load balancer for the scaleset. Can be a call to |
... |
For the specific VM configurations, other customisation arguments to be passed to |
options |
Scaleset options, as obtained via a call to |
image |
For |
vnet |
The virtual network for the scaleset. Can be a call to |
load_balancer_address |
The public IP address for the load balancer. Can be a call to |
autoscaler |
The autoscaler for the scaleset. Can be a call to |
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. |
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 name | Contents | Description |
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 |
subnet | subnet | Subnet 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 |
lbFrontendName | frontend | Load balancer frontend IP configuration name. Only defined if a load balancer was created or supplied as an az_resource object. |
lbBackendName | backend | Load 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".
An object of S3 class vmss_config
, that can be used by the create_vm_scaleset
method.
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.