Cannot create a VM within a Virtual Network #525

tomconte opened this Issue May 14, 2013 · 5 comments


None yet

6 participants


I can't get the vm create command to create a (Linux) VM within a Virtual Network. When I add the --virtual-network-name and --affinity-group options I get the following:

$ azure vm create -v --virtual-network-name cdh --affinity-group cdh-AG --vm-size small --ssh 22 --ssh-cert ./myCert.pem mycdh b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130415-en-us-30GB tom 'password'
info: Executing command vm create
verbose: looking for image b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130415-en-us-30GB
verbose: Looking up image
verbose: Checking for existence of mycdh cloud service
verbose: Looking up cloud service
error: undefined is not a function
verbose: stack TypeError: undefined is not a function
at /usr/local/lib/node_modules/azure-cli/lib/commands/vm.js:1126:15
at callback_ (/usr/local/lib/node_modules/azure-cli/lib/util/utils.js:156:9)
at finalCallback (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/serviceManagement/servicemanagementservice.js:743:7)
at /usr/local/lib/node_modules/azure-cli/lib/util/utils.js:215:9
at /usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/core/serviceclient.js:403:15
at /usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/core/serviceclient.js:616:11
at /usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/core/serviceclient.js:402:13
at /usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/serviceManagement/servicemanagementservice.js:746:5
at Request.processResponseCallback as _callback
at Request.self.callback (/usr/local/lib/node_modules/azure-cli/node_modules/azure/node_modules/request/index.js:148:22)

@eduardkoller eduardkoller was assigned May 14, 2013

@eduardkoller Can you investigate this with the customer


@anuchandy Can you please take a look?


Hi guys,

In order to make it work I have modified /usr/local/lib/node_modules/azure-cli/lib/commands/vm.js, and moved the definition of _svcMgmtRoleCreateInternal to the top of function doSvcMgmtRoleCreate. Otherwise it's undefined when reaching the case where an affinityGroup is specified instead of a Location...


Hitting this as well. I'll take a look with current sprint bits to help verify if needed!

ghost commented Jun 11, 2013

Verified this is fixed in the current dev branch.

@guangyang guangyang closed this Aug 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment