az_vmss_template: Virtual machine scaleset (cluster) template class

Description Format Details Fields Methods Instance operations See Also Examples

Description

Class representing a virtual machine scaleset deployment template. This class keeps track of all resources that are created as part of deploying a scaleset, and exposes methods for managing them.

Format

An R6 object of class az_vmss_template, inheriting from AzureRMR::az_template.

Details

A virtual machine scaleset in Azure is actually a collection of resources, including any and all of the following.

By wrapping the deployment template used to create these resources, the az_vmss_template class allows managing them all as a single entity.

Fields

The following fields are exposed, in addition to those provided by the AzureRMR::az_template class.

Methods

The following methods are available, in addition to those provided by the AzureRMR::az_template class.

Many of these methods are actually provided by the az_vmss_resource class, and propagated to the template as active bindings.

Instance operations

AzureVM has the ability to parallelise scaleset instance operations using a background process pool provided by AzureRMR. This can lead to significant speedups when working with scalesets with high instance counts. The pool is created automatically the first time that it is required, and remains persistent for the session. You can control the size of the process pool with the azure_vm_minpoolsize and azure_vm_maxpoolsize options, which have default values 2 and 10 respectively.

The id argument lets you specify a subset of instances on which to carry out an operation. This can be a character vector of instance IDs; a list of instance objects such as returned by list_instances; or a single instance object. The default (NULL) is to carry out the operation on all instances.

See Also

AzureRMR::az_template, create_vm_scaleset, get_vm_scaleset, delete_vm_scaleset, AzureRMR::init_pool

VM scaleset API reference

Examples

 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
## Not run: 

sub <- AzureRMR::get_azure_login()$
    get_subscription("subscription_id")

vmss <- sub$get_vm_scaleset("myscaleset")

vmss$identity

vmss$get_public_ip_address()  # NA if the scaleset doesn't have a load balancer

vmss$start()
vmss$get_vm_private_ip_addresses()
vmss$get_vm_public_ip_addresses()  # NA if scaleset nodes are not publicly visible

instances <- vmss$list_instances()
first <- instances[1]
vmss$run_script("echo hello world! > /tmp/hello.txt", id=first)
vmss$stop(id=first)
vmss$reimage(id=first)

vmss$sync_vmss_status()


## End(Not run)

AzureVM documentation built on Oct. 23, 2020, 5:20 p.m.