1
votes

I am using the Windows Azure SDK for Python to provision Linux VMs from a Python program using the Service Management API.

Apparently Azure makes it possible to connect VMs directly in a single virtual network:

http://www.windowsazure.com/en-us/manage/services/networking/add-a-vm-to-a-virtual-network/

This feature is exposed in the REST API, for instance to create a new VM:

http://msdn.microsoft.com/en-us/library/windowsazure/jj157181

and to create a new VM deployment in a given virtual network:

http://msdn.microsoft.com/en-us/library/windowsazure/jj157194

However by reading the source code of the Python SDK, it seems that this feature is not exposed in the Python API:

https://github.com/WindowsAzure/azure-sdk-for-python/blob/master/src/azure/servicemanagement/servicemanagementservice.py#L850

Is this a known issue? How to provision Azure virtual networks and VM from a Python program? Do I have to generate the XML of the network and the VM deployment by my-self instead?

1

1 Answers

1
votes

Apparently this is a known issue: https://github.com/WindowsAzure/azure-sdk-for-python/issues/79

When creating a virtual machine with create_virtual_machine_deployment, you cannot specify a VirtualNetworkName for the delpoyed VM.

Possible fix : . add virtual_network_name=None parameter in create_virtual_machine_deployment and virtual_machine_deployment_to_xml and set VirtualNetworkName in xml (right after ) if virtual_network_name: xml+= _XmlSerializer.data_to_xml([('VirtualNetworkName', virtual_network_name)])