VirtualMachineConfiguration Class

The configuration for Compute Nodes in a Pool based on the Azure Virtual Machines infrastructure.

All required parameters must be populated in order to send to Azure.

Inheritance
msrest.serialization.Model
VirtualMachineConfiguration

Constructor

VirtualMachineConfiguration(*, image_reference, node_agent_sku_id: str, windows_configuration=None, data_disks=None, license_type: str = None, container_configuration=None, disk_encryption_configuration=None, node_placement_configuration=None, extensions=None, os_disk=None, security_profile=None, service_artifact_reference=None, **kwargs)

Parameters

Name Description
image_reference
Required

Required. A reference to the Azure Virtual Machines Marketplace Image or the custom Virtual Machine Image to use.

node_agent_sku_id
Required
str

Required. The Batch Compute Node agent is a program that runs on each Compute Node in the Pool, and provides the command-and-control interface between the Compute Node and the Batch service. There are different implementations of the Compute Node agent, known as SKUs, for different operating systems. You must specify a Compute Node agent SKU which matches the selected Image reference. To get the list of supported Compute Node agent SKUs along with their list of verified Image references, see the 'List supported Compute Node agent SKUs' operation.

windows_configuration
Required

Windows operating system settings on the virtual machine. This property must not be specified if the imageReference property specifies a Linux OS Image.

data_disks
Required

This property must be specified if the Compute Nodes in the Pool need to have empty data disks attached to them. This cannot be updated. Each Compute Node gets its own disk (the disk is not a file share). Existing disks cannot be attached, each attached disk is empty. When the Compute Node is removed from the Pool, the disk and all data associated with it is also deleted. The disk is not formatted after being attached, it must be formatted before use - for more information see https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/attach-disk#initialize-a-new-data-disk-in-linux and https://docs.microsoft.com/en-us/azure/virtual-machines/windows/attach-disk-ps#add-an-empty-data-disk-to-a-virtual-machine.

license_type
Required
str

This only applies to Images that contain the Windows operating system, and should only be used when you hold valid on-premises licenses for the Compute Nodes which will be deployed. If omitted, no on-premises licensing discount is applied. Values are: Windows_Server - The on-premises license is for Windows Server. Windows_Client - The on-premises license is for Windows Client.

container_configuration
Required

The container configuration for the Pool. If specified, setup is performed on each Compute Node in the Pool to allow Tasks to run in containers. All regular Tasks and Job manager Tasks run on this Pool must specify the containerSettings property, and all other Tasks may specify it.

disk_encryption_configuration
Required

The disk encryption configuration for the pool. If specified, encryption is performed on each node in the pool during node provisioning.

node_placement_configuration
Required

The node placement configuration for the pool. This configuration will specify rules on how nodes in the pool will be physically allocated.

extensions
Required

If specified, the extensions mentioned in this configuration will be installed on each node.

os_disk
Required

Settings for the operating system disk of the Virtual Machine.

security_profile
Required

Specifies the security profile settings for the virtual machine or virtual machine scale set.

service_artifact_reference
Required

Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. The service artifact reference id in the form of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}

Keyword-Only Parameters

Name Description
image_reference
Required
node_agent_sku_id
Required
windows_configuration
Required
data_disks
Required
license_type
Required
container_configuration
Required
disk_encryption_configuration
Required
node_placement_configuration
Required
extensions
Required
os_disk
Required
security_profile
Required
service_artifact_reference
Required

Methods

as_dict

Return a dict that can be JSONify using json.dump.

Advanced usage might optionally use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains 'type' with the msrest type and 'key' with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

deserialize

Parse a str using the RestAPI syntax and return a model.

enable_additional_properties_sending
from_dict

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

is_xml_model
serialize

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

validate

Validate this model recursively and return a list of ValidationError.

as_dict

Return a dict that can be JSONify using json.dump.

Advanced usage might optionally use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains 'type' with the msrest type and 'key' with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Parameters

Name Description
key_transformer
<xref:function>

A key transformer function.

keep_readonly
default value: True

Returns

Type Description

A dict JSON compatible object

deserialize

Parse a str using the RestAPI syntax and return a model.

deserialize(data, content_type=None)

Parameters

Name Description
data
Required
str

A str using RestAPI structure. JSON by default.

content_type
str

JSON by default, set application/xml if XML.

default value: None

Returns

Type Description

An instance of this model

Exceptions

Type Description
DeserializationError if something went wrong

enable_additional_properties_sending

enable_additional_properties_sending()

from_dict

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

from_dict(data, key_extractors=None, content_type=None)

Parameters

Name Description
data
Required

A dict using RestAPI structure

content_type
str

JSON by default, set application/xml if XML.

default value: None
key_extractors
default value: None

Returns

Type Description

An instance of this model

Exceptions

Type Description
DeserializationError if something went wrong

is_xml_model

is_xml_model()

serialize

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

serialize(keep_readonly=False, **kwargs)

Parameters

Name Description
keep_readonly

If you want to serialize the readonly attributes

default value: False

Returns

Type Description

A dict JSON compatible object

validate

Validate this model recursively and return a list of ValidationError.

validate()

Returns

Type Description

A list of validation error