You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/batch/batch-linux-nodes.md
+47-81Lines changed: 47 additions & 81 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ editor: ''
10
10
ms.assetid: dc6ba151-1718-468a-b455-2da549225ab2
11
11
ms.service: batch
12
12
ms.topic: article
13
-
ms.tgt_pltfrm:
13
+
ms.tgt_pltfrm:
14
14
ms.workload: na
15
15
ms.date: 06/01/2018
16
16
ms.author: labrenne
@@ -43,7 +43,7 @@ When you configure a virtual machine image reference, you specify the properties
43
43
| --- | --- |
44
44
| Publisher |Canonical |
45
45
| Offer |UbuntuServer |
46
-
| SKU |14.04.4-LTS |
46
+
| SKU |18.04-LTS |
47
47
| Version |latest |
48
48
49
49
> [!TIP]
@@ -54,7 +54,7 @@ When you configure a virtual machine image reference, you specify the properties
54
54
### Node agent SKU
55
55
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:
56
56
57
-
* batch.node.ubuntu 14.04
57
+
* batch.node.ubuntu 18.04
58
58
* batch.node.centos 7
59
59
* batch.node.windows amd64
60
60
@@ -66,7 +66,7 @@ The Batch node agent is a program that runs on each node in the pool and provide
66
66
## Create a Linux pool: Batch Python
67
67
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.
68
68
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.
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.
126
126
127
127
```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()
130
130
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
# Pick the first image reference from the list of verified references
136
-
ir = ubuntu1404agent.verified_image_references[0]
140
+
ifimage isNone:
141
+
raiseRuntimeError('invalid image reference for desired configuration')
137
142
138
143
# Create the VirtualMachineConfiguration, specifying the VM image
139
144
# reference and the Batch node agent to be installed on the node.
140
145
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)
143
148
```
144
149
145
150
## Create a Linux pool: Batch .NET
146
151
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.
147
152
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.
149
154
150
155
```csharp
151
156
// Pool settings
152
157
conststringpoolId="LinuxNodesSamplePoolDotNet";
153
-
conststringvmSize="STANDARD_A1";
158
+
conststringvmSize="STANDARD_D2_V3";
154
159
constintnodeCount=1;
155
160
156
161
// Obtain a collection of all available node agent SKUs.
157
162
// This allows us to select from a list of supported
// Create the unbound pool object using the VirtualMachineConfiguration
185
186
// created above
@@ -193,53 +194,18 @@ CloudPool pool = batchClient.PoolOperations.CreatePool(
193
194
awaitpool.CommitAsync();
194
195
```
195
196
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:
197
198
198
199
```csharp
199
200
ImageReferenceimageReference=newImageReference(
200
201
publisher: "Canonical",
201
202
offer: "UbuntuServer",
202
-
sku: "14.04.2-LTS",
203
+
sku: "18.04-LTS",
203
204
version: "latest");
204
205
```
205
206
206
207
## 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.
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.
243
209
244
210
## Connect to Linux nodes using SSH
245
211
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.
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.
317
283
318
284
## 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.
320
286
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.
322
288
323
289
## Next steps
324
290
@@ -336,7 +302,7 @@ The [Python code samples][github_samples_py] in the [azure-batch-samples][github
0 commit comments