-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
BatchVmConfiguration.cs
145 lines (135 loc) · 11.4 KB
/
BatchVmConfiguration.cs
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
using Azure.Core;
using Azure.ResourceManager.Resources.Models;
namespace Azure.ResourceManager.Batch.Models
{
/// <summary> The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure. </summary>
public partial class BatchVmConfiguration
{
/// <summary> Initializes a new instance of <see cref="BatchVmConfiguration"/>. </summary>
/// <param name="imageReference"> A reference to an Azure Virtual Machines Marketplace image or the Azure Image resource of a custom Virtual Machine. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation. </param>
/// <param name="nodeAgentSkuId"> The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. </param>
/// <exception cref="ArgumentNullException"> <paramref name="imageReference"/> or <paramref name="nodeAgentSkuId"/> is null. </exception>
public BatchVmConfiguration(BatchImageReference imageReference, string nodeAgentSkuId)
{
Argument.AssertNotNull(imageReference, nameof(imageReference));
Argument.AssertNotNull(nodeAgentSkuId, nameof(nodeAgentSkuId));
ImageReference = imageReference;
NodeAgentSkuId = nodeAgentSkuId;
DataDisks = new ChangeTrackingList<BatchVmDataDisk>();
Extensions = new ChangeTrackingList<BatchVmExtension>();
}
/// <summary> Initializes a new instance of <see cref="BatchVmConfiguration"/>. </summary>
/// <param name="imageReference"> A reference to an Azure Virtual Machines Marketplace image or the Azure Image resource of a custom Virtual Machine. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation. </param>
/// <param name="nodeAgentSkuId"> The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. </param>
/// <param name="windowsConfiguration"> This property must not be specified if the imageReference specifies a Linux OS image. </param>
/// <param name="dataDisks"> This property must be specified if the compute nodes in the pool need to have empty data disks attached to them. </param>
/// <param name="licenseType">
/// 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 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.
///
/// </param>
/// <param name="containerConfiguration"> If specified, setup is performed on each 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. </param>
/// <param name="diskEncryptionConfiguration"> If specified, encryption is performed on each node in the pool during node provisioning. </param>
/// <param name="nodePlacementConfiguration"> This configuration will specify rules on how nodes in the pool will be physically allocated. </param>
/// <param name="extensions"> If specified, the extensions mentioned in this configuration will be installed on each node. </param>
/// <param name="osDisk"> Contains configuration for ephemeral OSDisk settings. </param>
/// <param name="securityProfile"> Specifies the security profile settings for the virtual machine or virtual machine scale set. </param>
/// <param name="serviceArtifactReference"> The service artifact reference id in the form of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. </param>
internal BatchVmConfiguration(BatchImageReference imageReference, string nodeAgentSkuId, WindowsConfiguration windowsConfiguration, IList<BatchVmDataDisk> dataDisks, string licenseType, BatchVmContainerConfiguration containerConfiguration, DiskEncryptionConfiguration diskEncryptionConfiguration, NodePlacementConfiguration nodePlacementConfiguration, IList<BatchVmExtension> extensions, BatchOSDisk osDisk, BatchSecurityProfile securityProfile, WritableSubResource serviceArtifactReference)
{
ImageReference = imageReference;
NodeAgentSkuId = nodeAgentSkuId;
WindowsConfiguration = windowsConfiguration;
DataDisks = dataDisks;
LicenseType = licenseType;
ContainerConfiguration = containerConfiguration;
DiskEncryptionConfiguration = diskEncryptionConfiguration;
NodePlacementConfiguration = nodePlacementConfiguration;
Extensions = extensions;
OSDisk = osDisk;
SecurityProfile = securityProfile;
ServiceArtifactReference = serviceArtifactReference;
}
/// <summary> A reference to an Azure Virtual Machines Marketplace image or the Azure Image resource of a custom Virtual Machine. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation. </summary>
public BatchImageReference ImageReference { get; set; }
/// <summary> The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. </summary>
public string NodeAgentSkuId { get; set; }
/// <summary> This property must not be specified if the imageReference specifies a Linux OS image. </summary>
internal WindowsConfiguration WindowsConfiguration { get; set; }
/// <summary> If omitted, the default value is true. </summary>
public bool? IsAutomaticUpdateEnabled
{
get => WindowsConfiguration is null ? default : WindowsConfiguration.IsAutomaticUpdateEnabled;
set
{
if (WindowsConfiguration is null)
WindowsConfiguration = new WindowsConfiguration();
WindowsConfiguration.IsAutomaticUpdateEnabled = value;
}
}
/// <summary> This property must be specified if the compute nodes in the pool need to have empty data disks attached to them. </summary>
public IList<BatchVmDataDisk> DataDisks { get; }
/// <summary>
/// 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 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.
///
/// </summary>
public string LicenseType { get; set; }
/// <summary> If specified, setup is performed on each 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. </summary>
public BatchVmContainerConfiguration ContainerConfiguration { get; set; }
/// <summary> If specified, encryption is performed on each node in the pool during node provisioning. </summary>
internal DiskEncryptionConfiguration DiskEncryptionConfiguration { get; set; }
/// <summary> On Linux pool, only "TemporaryDisk" is supported; on Windows pool, "OsDisk" and "TemporaryDisk" must be specified. </summary>
public IList<BatchDiskEncryptionTarget> DiskEncryptionTargets
{
get
{
if (DiskEncryptionConfiguration is null)
DiskEncryptionConfiguration = new DiskEncryptionConfiguration();
return DiskEncryptionConfiguration.Targets;
}
}
/// <summary> This configuration will specify rules on how nodes in the pool will be physically allocated. </summary>
internal NodePlacementConfiguration NodePlacementConfiguration { get; set; }
/// <summary> Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy. </summary>
public BatchNodePlacementPolicyType? NodePlacementPolicy
{
get => NodePlacementConfiguration is null ? default : NodePlacementConfiguration.Policy;
set
{
if (NodePlacementConfiguration is null)
NodePlacementConfiguration = new NodePlacementConfiguration();
NodePlacementConfiguration.Policy = value;
}
}
/// <summary> If specified, the extensions mentioned in this configuration will be installed on each node. </summary>
public IList<BatchVmExtension> Extensions { get; }
/// <summary> Contains configuration for ephemeral OSDisk settings. </summary>
public BatchOSDisk OSDisk { get; set; }
/// <summary> Specifies the security profile settings for the virtual machine or virtual machine scale set. </summary>
public BatchSecurityProfile SecurityProfile { get; set; }
/// <summary> The service artifact reference id in the form of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. </summary>
internal WritableSubResource ServiceArtifactReference { get; set; }
/// <summary> Gets or sets Id. </summary>
public ResourceIdentifier ServiceArtifactReferenceId
{
get => ServiceArtifactReference is null ? default : ServiceArtifactReference.Id;
set
{
if (ServiceArtifactReference is null)
ServiceArtifactReference = new WritableSubResource();
ServiceArtifactReference.Id = value;
}
}
}
}