|
3 | 3 | # Authenticate Batch account CLI session.
|
4 | 4 | az batch account login -g myresource group -n mybatchaccount
|
5 | 5 |
|
6 |
| -# Create a new Windows PaaS pool with 3 Standard A1 VMs. |
7 |
| -az batch pool create \ |
8 |
| - --id mypool-windows \ |
9 |
| - --os-family 4 \ |
10 |
| - --target-dedicated 3 \ |
11 |
| - --vm-size small \ |
12 |
| - |
13 |
| -# We can add some metadata to the pool. |
14 |
| -az batch pool set --pool-id mypool-windows --metadata IsWindows=true VMSize=StandardA1 |
15 |
| - |
16 |
| -# Retrieve a list of available IaaS images and node agent SKUs |
| 6 | +# Retrieve a list of available images and node agent SKUs. |
17 | 7 | az batch pool node-agent-skus list
|
18 | 8 |
|
19 |
| -# Create a new Linux IaaS pool with an application reference and a start task that will |
20 |
| -# copy the application files to a shared directory. The image reference and node agent SKUs |
21 |
| -# ID can be selected from the ouptputs of the above list command. |
| 9 | +# Create a new Linux pool with a virtual machine configuration. The image reference |
| 10 | +# and node agent SKUs ID can be selected from the ouptputs of the above list command. |
22 | 11 | # The image reference is in the format: {publisher}:{offer}:{sku}:{version} where {version} is
|
23 | 12 | # optional and will default to 'latest'.
|
24 | 13 | az batch pool create \
|
25 | 14 | --id mypool-linux \
|
26 | 15 | --vm-size Standard_A1 \
|
27 | 16 | --image canonical:ubuntuserver:16.04.0-LTS \
|
28 |
| - --node-agent-sku-id batch.node.ubuntu 16.04 \ |
29 |
| - --start-task-command-line "cmd /c xcopy %AZ_BATCH_APP_PACKAGE_MYAPP% %AZ_BATCH_NODE_SHARED_DIR%" \ |
30 |
| - --start-task-wait-for-success \ |
31 |
| - --application-package-references myapp |
| 17 | + --node-agent-sku-id batch.node.ubuntu 16.04 |
32 | 18 |
|
33 |
| -# Now lets resize the IaaS pool to start up some VMs. |
| 19 | +# Now let's resize the pool to start up some VMs. |
34 | 20 | az batch pool resize --pool-id mypool-linux --target-dedicated 5
|
35 | 21 |
|
36 |
| -# We can check the status of the pool to see when it has finished resizing |
| 22 | +# We can check the status of the pool to see when it has finished resizing. |
37 | 23 | az batch pool show --pool-id mypool-linux
|
38 | 24 |
|
39 | 25 | # List the compute nodes running in a pool.
|
40 | 26 | az batch node list --pool-id mypool-linux
|
41 | 27 |
|
42 | 28 | # If a particular node in the pool is having issues, it can be rebooted or reimaged.
|
43 | 29 | # The ID of the node can be retrieved with the list command above.
|
44 |
| -az batch node reboot --pool-id mypool-linux --node-id node1 |
| 30 | +# A typical node ID will be in the format 'tvm-xxxxxxxxxx_1-<timestamp>'. |
| 31 | +az batch node reboot --pool-id mypool-linux --node-id tvm-123_1-20170316t000000z |
45 | 32 |
|
46 | 33 | # Alternatively, one or more compute nodes can be deleted from the pool, and any
|
47 | 34 | # work already assigned to it can be re-allocated to another node.
|
48 | 35 | az batch node delete \
|
49 | 36 | --pool-id mypool-linux \
|
50 |
| - --node-list node1 node2 \ |
| 37 | + --node-list tvm-123_1-20170316t000000z tvm-123_2-20170316t000000z \ |
51 | 38 | --node-deallocation-option requeue
|
0 commit comments