Skip to content

Commit ff95882

Browse files
authored
Merge pull request #49075 from alfpark/alpark/fix-na-sku-list
Update API calls and remove outdated compat table
2 parents 0371fa5 + 33bee87 commit ff95882

File tree

1 file changed

+47
-81
lines changed

1 file changed

+47
-81
lines changed

articles/batch/batch-linux-nodes.md

Lines changed: 47 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ editor: ''
1010
ms.assetid: dc6ba151-1718-468a-b455-2da549225ab2
1111
ms.service: batch
1212
ms.topic: article
13-
ms.tgt_pltfrm:
13+
ms.tgt_pltfrm:
1414
ms.workload: na
1515
ms.date: 06/01/2018
1616
ms.author: labrenne
@@ -43,7 +43,7 @@ When you configure a virtual machine image reference, you specify the properties
4343
| --- | --- |
4444
| Publisher |Canonical |
4545
| Offer |UbuntuServer |
46-
| SKU |14.04.4-LTS |
46+
| SKU |18.04-LTS |
4747
| Version |latest |
4848

4949
> [!TIP]
@@ -54,7 +54,7 @@ When you configure a virtual machine image reference, you specify the properties
5454
### Node agent SKU
5555
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. Essentially, when you create a Virtual Machine Configuration, you first specify the virtual machine image reference, and then you specify the node agent to install on the image. Typically, each node agent SKU is compatible with multiple virtual machine images. Here are a few examples of node agent SKUs:
5656

57-
* batch.node.ubuntu 14.04
57+
* batch.node.ubuntu 18.04
5858
* batch.node.centos 7
5959
* batch.node.windows amd64
6060

@@ -66,7 +66,7 @@ The Batch node agent is a program that runs on each node in the pool and provide
6666
## Create a Linux pool: Batch Python
6767
The following code snippet shows an example of how to use the [Microsoft Azure Batch Client Library for Python][py_batch_package] to create a pool of Ubuntu Server compute nodes. Reference documentation for the Batch Python module can be found at [azure.batch package][py_batch_docs] on Read the Docs.
6868

69-
This snippet creates an [ImageReference][py_imagereference] explicitly and specifies each of its properties (publisher, offer, SKU, version). In production code, however, we recommend that you use the [list_node_agent_skus][py_list_skus] method to determine and select from the available image and node agent SKU combinations at runtime.
69+
This snippet creates an [ImageReference][py_imagereference] explicitly and specifies each of its properties (publisher, offer, SKU, version). In production code, however, we recommend that you use the [list_supported_images][py_list_supported_images] method to determine and select from the available image and node agent SKU combinations at runtime.
7070

7171
```python
7272
# Import the required modules from the
@@ -82,7 +82,7 @@ batch_url = "<batch-account-url>"
8282

8383
# Pool settings
8484
pool_id = "LinuxNodesSamplePoolPython"
85-
vm_size = "STANDARD_A1"
85+
vm_size = "STANDARD_D2_V3"
8686
node_count = 1
8787

8888
# Initialize the Batch client
@@ -105,15 +105,15 @@ new_pool.start_task = start_task
105105
ir = batchmodels.ImageReference(
106106
publisher="Canonical",
107107
offer="UbuntuServer",
108-
sku="14.04.2-LTS",
108+
sku="18.04-LTS",
109109
version="latest")
110110

111111
# Create the VirtualMachineConfiguration, specifying
112112
# the VM image reference and the Batch node agent to
113113
# be installed on the node.
114114
vmc = batchmodels.VirtualMachineConfiguration(
115115
image_reference=ir,
116-
node_agent_sku_id="batch.node.ubuntu 14.04")
116+
node_agent_sku_id="batch.node.ubuntu 18.04")
117117

118118
# Assign the virtual machine configuration to the pool
119119
new_pool.virtual_machine_configuration = vmc
@@ -122,64 +122,65 @@ new_pool.virtual_machine_configuration = vmc
122122
client.pool.add(new_pool)
123123
```
124124

125-
As mentioned previously, we recommend that instead of creating the [ImageReference][py_imagereference] explicitly, you use the [list_node_agent_skus][py_list_skus] method to dynamically select from the currently supported node agent/Marketplace image combinations. The following Python snippet shows how to use this method.
125+
As mentioned previously, we recommend that instead of creating the [ImageReference][py_imagereference] explicitly, you use the [list_supported_images][py_list_supported_images] method to dynamically select from the currently supported node agent/Marketplace image combinations. The following Python snippet shows how to use this method.
126126

127127
```python
128-
# Get the list of node agents from the Batch service
129-
nodeagents = client.account.list_node_agent_skus()
128+
# Get the list of supported images from the Batch service
129+
images = client.account.list_supported_images()
130130

131-
# Obtain the desired node agent
132-
ubuntu1404agent = next(
133-
agent for agent in nodeagents if "ubuntu 14.04" in agent.id)
131+
# Obtain the desired image reference
132+
image = None
133+
for img in images:
134+
if (img.image_reference.publisher.lower() == "canonical" and
135+
img.image_reference.offer.lower() == "ubuntuserver" and
136+
img.image_reference.sku.lower() == "18.04-lts"):
137+
image = img
138+
break
134139

135-
# Pick the first image reference from the list of verified references
136-
ir = ubuntu1404agent.verified_image_references[0]
140+
if image is None:
141+
raise RuntimeError('invalid image reference for desired configuration')
137142

138143
# Create the VirtualMachineConfiguration, specifying the VM image
139144
# reference and the Batch node agent to be installed on the node.
140145
vmc = batchmodels.VirtualMachineConfiguration(
141-
image_reference=ir,
142-
node_agent_sku_id=ubuntu1404agent.id)
146+
image_reference=image.image_reference,
147+
node_agent_sku_id=image.node_agent_sku_id)
143148
```
144149

145150
## Create a Linux pool: Batch .NET
146151
The following code snippet shows an example of how to use the [Batch .NET][nuget_batch_net] client library to create a pool of Ubuntu Server compute nodes. You can find the [Batch .NET reference documentation][api_net] on docs.microsoft.com.
147152

148-
The following code snippet uses the [PoolOperations][net_pool_ops].[ListNodeAgentSkus][net_list_skus] method to select from the list of currently supported Marketplace image and node agent SKU combinations. This technique is desirable because the list of supported combinations may change from time to time. Most commonly, supported combinations are added.
153+
The following code snippet uses the [PoolOperations][net_pool_ops].[ListSupportedImages][net_list_supported_images] method to select from the list of currently supported Marketplace image and node agent SKU combinations. This technique is desirable because the list of supported combinations may change from time to time. Most commonly, supported combinations are added.
149154

150155
```csharp
151156
// Pool settings
152157
const string poolId = "LinuxNodesSamplePoolDotNet";
153-
const string vmSize = "STANDARD_A1";
158+
const string vmSize = "STANDARD_D2_V3";
154159
const int nodeCount = 1;
155160

156161
// Obtain a collection of all available node agent SKUs.
157162
// This allows us to select from a list of supported
158163
// VM image/node agent combinations.
159-
List<NodeAgentSku> nodeAgentSkus =
160-
batchClient.PoolOperations.ListNodeAgentSkus().ToList();
161-
162-
// Define a delegate specifying properties of the VM image
163-
// that we wish to use.
164-
Func<ImageReference, bool> isUbuntu1404 = imageRef =>
165-
imageRef.Publisher == "Canonical" &&
166-
imageRef.Offer == "UbuntuServer" &&
167-
imageRef.Sku.Contains("14.04");
168-
169-
// Obtain the first node agent SKU in the collection that matches
170-
// Ubuntu Server 14.04. Note that there are one or more image
171-
// references associated with this node agent SKU.
172-
NodeAgentSku ubuntuAgentSku = nodeAgentSkus.First(sku =>
173-
sku.VerifiedImageReferences.Any(isUbuntu1404));
174-
175-
// Select an ImageReference from those available for node agent.
176-
ImageReference imageReference =
177-
ubuntuAgentSku.VerifiedImageReferences.First(isUbuntu1404);
164+
List<ImageInformation> images =
165+
batchClient.PoolOperations.ListSupportedImages().ToList();
166+
167+
// Find the appropriate image information
168+
ImageInformation image = null;
169+
foreach (var img in images)
170+
{
171+
if (img.ImageReference.Publisher == "Canonical" &&
172+
img.ImageReference.Offer == "UbuntuServer" &&
173+
img.ImageReference.Sku == "18.04-LTS")
174+
{
175+
image = img;
176+
break;
177+
}
178+
}
178179

179180
// Create the VirtualMachineConfiguration for use when actually
180181
// creating the pool
181182
VirtualMachineConfiguration virtualMachineConfiguration =
182-
new VirtualMachineConfiguration(imageReference, ubuntuAgentSku.Id);
183+
new VirtualMachineConfiguration(image.ImageReference, image.NodeAgentSkuId);
183184

184185
// Create the unbound pool object using the VirtualMachineConfiguration
185186
// created above
@@ -193,53 +194,18 @@ CloudPool pool = batchClient.PoolOperations.CreatePool(
193194
await pool.CommitAsync();
194195
```
195196

196-
Although the previous snippet uses the [PoolOperations][net_pool_ops].[ListNodeAgentSkus][net_list_skus] method to dynamically list and select from supported image and node agent SKU combinations (recommended), you can also configure an [ImageReference][net_imagereference] explicitly:
197+
Although the previous snippet uses the [PoolOperations][net_pool_ops].[ListSupportedImages][net_list_supported_images] method to dynamically list and select from supported image and node agent SKU combinations (recommended), you can also configure an [ImageReference][net_imagereference] explicitly:
197198

198199
```csharp
199200
ImageReference imageReference = new ImageReference(
200201
publisher: "Canonical",
201202
offer: "UbuntuServer",
202-
sku: "14.04.2-LTS",
203+
sku: "18.04-LTS",
203204
version: "latest");
204205
```
205206

206207
## List of virtual machine images
207-
The following table lists the Marketplace virtual machine images that are compatible with the available Batch node agents when this article was last updated. It is important to note that this list is not definitive because images and node agents may be added or removed at any time. We recommend that your Batch applications and services always use [list_node_agent_skus][py_list_skus] (Python) or [ListNodeAgentSkus][net_list_skus] (Batch .NET) to determine and select from the currently available SKUs.
208-
209-
> [!WARNING]
210-
> The following list may change at any time. Always use the **list node agent SKU** methods available in the Batch APIs to list the compatible virtual machine and node agent SKUs when you run your Batch jobs.
211-
>
212-
>
213-
214-
| **Publisher** | **Offer** | **Image SKU** | **Version** | **Node agent SKU ID** |
215-
| ------------- | --------- | ------------- | ----------- | --------------------- |
216-
| batch | rendering-centos73 | rendering | latest | batch.node.centos 7 |
217-
| batch | rendering-windows2016 | rendering | latest | batch.node.windows amd64 |
218-
| Canonical | UbuntuServer | 16.04-LTS | latest | batch.node.ubuntu 16.04 |
219-
| Canonical | UbuntuServer | 14.04.5-LTS | latest | batch.node.ubuntu 14.04 |
220-
| Credativ | Debian | 9 | latest | batch.node.debian 9 |
221-
| Credativ | Debian | 8 | latest | batch.node.debian 8 |
222-
| microsoft-ads | linux-data-science-vm | linuxdsvm | latest | batch.node.centos 7 |
223-
| microsoft-ads | standard-data-science-vm | standard-data-science-vm | latest | batch.node.windows amd64 |
224-
| microsoft-azure-batch | centos-container | 7-4 | latest | batch.node.centos 7 |
225-
| microsoft-azure-batch | centos-container-rdma | 7-4 | latest | batch.node.centos 7 |
226-
| microsoft-azure-batch | ubuntu-server-container | 16-04-lts | latest | batch.node.ubuntu 16.04 |
227-
| microsoft-azure-batch | ubuntu-server-container-rdma | 16-04-lts | latest | batch.node.ubuntu 16.04 |
228-
| MicrosoftWindowsServer | WindowsServer | 2016-Datacenter | latest | batch.node.windows amd64 |
229-
| MicrosoftWindowsServer | WindowsServer | 2016-Datacenter-smalldisk | latest | batch.node.windows amd64 |
230-
| MicrosoftWindowsServer | WindowsServer | 2016-Datacenter-with-Containers | latest | batch.node.windows amd64 |
231-
| MicrosoftWindowsServer | WindowsServer | 2012-R2-Datacenter | latest | batch.node.windows amd64 |
232-
| MicrosoftWindowsServer | WindowsServer | 2012-R2-Datacenter-smalldisk | latest | batch.node.windows amd64 |
233-
| MicrosoftWindowsServer | WindowsServer | 2012-Datacenter | latest | batch.node.windows amd64 |
234-
| MicrosoftWindowsServer | WindowsServer | 2012-Datacenter-smalldisk | latest | batch.node.windows amd64 |
235-
| MicrosoftWindowsServer | WindowsServer | 2008-R2-SP1 | latest | batch.node.windows amd64 |
236-
| MicrosoftWindowsServer | WindowsServer | 2008-R2-SP1-smalldisk | latest | batch.node.windows amd64 |
237-
| OpenLogic | CentOS | 7.4 | latest | batch.node.centos 7 |
238-
| OpenLogic | CentOS-HPC | 7.4 | latest | batch.node.centos 7 |
239-
| OpenLogic | CentOS-HPC | 7.3 | latest | batch.node.centos 7 |
240-
| OpenLogic | CentOS-HPC | 7.1 | latest | batch.node.centos 7 |
241-
| Oracle | Oracle-Linux | 7.4 | latest | batch.node.centos 7 |
242-
| SUSE | SLES-HPC | 12-SP2 | latest | batch.node.opensuse 42.1 |
208+
To obtain the list of all supported Marketplace virtual machine images for the Batch service and their corresponding node agents, please leverage the [list_supported_images][py_list_supported_images] (Python), [ListSupportedImages][net_list_supported_images] (Batch .NET) or the corresponding API in the respective language SDK of your choosing.
243209

244210
## Connect to Linux nodes using SSH
245211
During development or while troubleshooting, you may find it necessary to sign in to the nodes in your pool. Unlike Windows compute nodes, you cannot use Remote Desktop Protocol (RDP) to connect to Linux nodes. Instead, the Batch service enables SSH access on each node for remote connection.
@@ -316,9 +282,9 @@ tvm-1219235766_4-20160414t192511z | ComputeNodeState.idle | 13.91.7.57 | 50001
316282
Instead of a password, you can specify an SSH public key when you create a user on a node. In the Python SDK, use the **ssh_public_key** parameter on [ComputeNodeUser][py_computenodeuser]. In .NET, use the [ComputeNodeUser][net_computenodeuser].[SshPublicKey][net_ssh_key] property.
317283

318284
## Pricing
319-
Azure Batch is built on Azure Cloud Services and Azure Virtual Machines technology. The Batch service itself is offered at no cost, which means you are charged only for the compute resources that your Batch solutions consume. When you choose **Cloud Services Configuration**, you are charged based on the [Cloud Services pricing][cloud_services_pricing] structure. When you choose **Virtual Machine Configuration**, you are charged based on the [Virtual Machines pricing][vm_pricing] structure.
285+
Azure Batch is built on Azure Cloud Services and Azure Virtual Machines technology. The Batch service itself is offered at no cost, which means you are charged only for the compute resources (and associated costs that entails) that your Batch solutions consume. When you choose **Cloud Services Configuration**, you are charged based on the [Cloud Services pricing][cloud_services_pricing] structure. When you choose **Virtual Machine Configuration**, you are charged based on the [Virtual Machines pricing][vm_pricing] structure.
320286

321-
If you deploy applications to your Batch nodes using [application packages](batch-application-packages.md), you are also charged for the Azure Storage resources that your application packages consume. In general, the Azure Storage costs are minimal.
287+
If you deploy applications to your Batch nodes using [application packages](batch-application-packages.md), you are also charged for the Azure Storage resources that your application packages consume.
322288

323289
## Next steps
324290

@@ -336,7 +302,7 @@ The [Python code samples][github_samples_py] in the [azure-batch-samples][github
336302
[net_cloudpool]: https://msdn.microsoft.com/library/azure/microsoft.azure.batch.cloudpool.aspx
337303
[net_computenodeuser]: /dotnet/api/microsoft.azure.batch.computenodeuser?view=azure-dotnet
338304
[net_imagereference]: https://msdn.microsoft.com/library/azure/microsoft.azure.batch.imagereference.aspx
339-
[net_list_skus]: https://msdn.microsoft.com/library/azure/microsoft.azure.batch.pooloperations.listnodeagentskus.aspx
305+
[net_list_supported_images]: https://docs.microsoft.com/dotnet/api/microsoft.azure.batch.pooloperations.listsupportedimages
340306
[net_pool_ops]: https://msdn.microsoft.com/library/azure/microsoft.azure.batch.pooloperations.aspx
341307
[net_ssh_key]: /dotnet/api/microsoft.azure.batch.computenodeuser.sshpublickey?view=azure-dotnet#Microsoft_Azure_Batch_ComputeNodeUser_SshPublicKey
342308
[nuget_batch_net]: https://www.nuget.org/packages/Microsoft.Azure.Batch/
@@ -347,6 +313,6 @@ The [Python code samples][github_samples_py] in the [azure-batch-samples][github
347313
[py_batch_package]: https://pypi.python.org/pypi/azure-batch
348314
[py_computenodeuser]: /python/api/azure-batch/azure.batch.models.computenodeuser
349315
[py_imagereference]: /python/api/azure-mgmt-batch/azure.mgmt.batch.models.imagereference
350-
[py_list_skus]: https://docs.microsoft.com/python/api/azure-batch/azure.batch.operations.AccountOperations?view=azure-python
316+
[py_list_supported_images]: https://docs.microsoft.com/python/api/azure-batch/azure.batch.operations.AccountOperations?view=azure-python
351317
[vm_marketplace]: https://azure.microsoft.com/marketplace/virtual-machines/
352318
[vm_pricing]: https://azure.microsoft.com/pricing/details/virtual-machines/

0 commit comments

Comments
 (0)