Skip to content

Commit 2a2c936

Browse files
committed
move virtual machine configuration to init as well
1 parent cdbc152 commit 2a2c936

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

articles/batch/batch-sig-images.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,6 @@ start_task = batchmodels.StartTask(
163163
)
164164
start_task.run_elevated = True
165165

166-
# Create the unbound pool
167-
new_pool = batchmodels.PoolAddParameter(
168-
id=pool_id,
169-
vm_size=vm_size,
170-
target_dedicated_nodes=node_count,
171-
start_task=start_task
172-
)
173-
174166
# Create an ImageReference which specifies the image from
175167
# Shared Image Gallery to install on the nodes.
176168
ir = batchmodels.ImageReference(
@@ -185,8 +177,14 @@ vmc = batchmodels.VirtualMachineConfiguration(
185177
node_agent_sku_id="batch.node.ubuntu 18.04"
186178
)
187179

188-
# Assign the virtual machine configuration to the pool
189-
new_pool.virtual_machine_configuration = vmc
180+
# Create the unbound pool
181+
new_pool = batchmodels.PoolAddParameter(
182+
id=pool_id,
183+
vm_size=vm_size,
184+
target_dedicated_nodes=node_count,
185+
virtual_machine_configuration=vmc,
186+
start_task=start_task
187+
)
190188

191189
# Create pool in the Batch service
192190
client.pool.add(new_pool)

0 commit comments

Comments
 (0)