Hi Shakeel Khan,
Kindly verify the Azure SDK Python version you are using. You can reference the below links for guidance:
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
Need help on Pool creation using Python SDK. I have a virtual network and also a subnet in my Azure account. I'm trying to create a pool under an existing batch account.
When I create it through the Azure portal I do not have any issues. The process is smooth and the pool and nodes are created successfully. I set the 'IP address provisioning type' parameter to 'NoPublicIPAddresses' and it asks me to change the 'Node communication Mode' to 'Simplified' and I do it. A IP is now created within the subnet.
When I try to do the same settings through Python SDK, everything seems right but I get a dumb error which I feel is unrelated.
This is my pool creation function:
def create_pool(batch_service_client: BatchServiceClient, pool_id: str):
"""
Creates a pool of compute nodes with the specified OS settings.
:param batch_service_client: A Batch service client.
:param str pool_id: An ID for the new pool.
:param str publisher: Marketplace image publisher
:param str offer: Marketplace image offer
:param str sku: Marketplace image sku
"""
print(f'Creating pool [{pool_id}]...')
# Create a new pool of Linux compute nodes using an Azure Virtual Machines
# Marketplace image. For more information about creating pools of Linux
# nodes, see:
# https://azure.microsoft.com/documentation/articles/batch-linux-nodes/
# Define the subnet resource ID
subnet_resource_id = config.SUBNET_ID
# Configure the network settings
network_config = batchmodels.NetworkConfiguration(
subnet_id=subnet_resource_id,
public_ip_address_configuration=batchmodels.PublicIPAddressConfiguration(
provision='noPublicIPAddresses' # Disable public IP addresses
)
)
new_pool = batchmodels.PoolAddParameter(
id=pool_id,
virtual_machine_configuration=batchmodels.VirtualMachineConfiguration(
image_reference=batchmodels.ImageReference(
publisher="microsoftwindowsserver",
offer="windowsserver",
sku="2022-datacenter-smalldisk",
version="latest"
),
node_agent_sku_id="batch.node.windows amd64"
),
user_accounts=[
batchmodels.UserAccount(
name="spot",
password="Algo&Qua35",
elevation_level=batchmodels.ElevationLevel.admin
)
],
vm_size=config.POOL_VM_SIZE,
target_dedicated_nodes=config.POOL_NODE_COUNT,
target_low_priority_nodes=config.POOL_LOW_PRIORITY_NODE_COUNT,
network_configuration=network_config,
enable_inter_node_communication=False
)
batch_service_client.pool.add(new_pool)
And the error I'm receiving with this is below:
The specified subnet acsys-prod-wvd has PrivateLinkServiceNetworkPolicies or PrivateEndpointNetworkPolicies enabled, please disable them to provision NoPublicAddresses Pool
But the annoying part here is that when I look at the subnet's setting in the azure portal for 'Private Endpoint Network Policies', the value is definitely 'DISABLED'.
If someone could through some light on this, I would be very grateful! Thanks in advance!
Hi Shakeel Khan,
Kindly verify the Azure SDK Python version you are using. You can reference the below links for guidance: