az_vm_template: Virtual machine template class

Description Format Details Fields Methods See Also Examples

Description

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

Format

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

Details

A single virtual machine 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_vm_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_vm_resource class, and propagated to the template as active bindings.

See Also

AzureRMR::az_template, create_vm, get_vm, delete_vm

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

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

vm <- sub$get_vm("myvm")

vm$identity

vm$start()
vm$get_private_ip_address()
vm$get_public_ip_address()

vm$run_script("echo hello world! > /tmp/hello.txt")

vm$stop()
vm$get_private_ip_address()
vm$get_public_ip_address()  # NA, assuming VM has a dynamic IP address

vm$resize("Standard_DS13_v2")
vm$sync_vm_status()


## End(Not run)

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