Quantcast
Channel: Azure Virtual Machines forum
Viewing all articles
Browse latest Browse all 12545

"A computer name must be specified" Error When Trying to Create a VM from Custom Image Using Cli

$
0
0

Hi

I have been trying for a little while to script my VM creation (from a custom Linux image) using the *nix CLI however I have not yet had success.  I'm getting an error "A computer name must be specified" when trying aazure vm create-from.  Here's the command I am running (note the actual names I'm using are different):

     azure vm create-from -v --virtual-network-name "test-network-1" "test-vm-1" role.json

(note that the network does exist)

and here's the role.json file:

{
"configurationSets": [
{
"configurationSetType":"LinuxProvisioningConfiguration",
"computerName":"test-vm-1",
}
],
"resourceExtensionReferences":[],
"roleName":"test-vm-1",
"roleType":"PersistentVMRole",
"label":"test-vm-1",
"location":"West US",
"oSVirtualHardDisk":
{
"sourceImageName": "custom-image-name"
},
"roleSize":"ExtraSmall",
"provisionGuestAgent":true
}

(obtained the image name from running a vm image list)

Running this in verbose mode gives the following:

----------------------------------------------------------------------------------------------------------------

verbose: Looking up deployment

verbose: Creating VM

error:   A computer name must be specified.

info:    Error information has been recorded to azure.err

verbose: Error: A computer name must be specified.

    at Function.ServiceClient._normalizeError (/usr/local/azure/node_modules/azure/node_modules/azure-common/lib/services/serviceclient.js:785:23)

    at /usr/local/azure/node_modules/azure/node_modules/azure-common/lib/services/filters/errorhandlingfilter.js:44:29

    at Request._callback (/usr/local/azure/node_modules/azure/node_modules/azure-common/lib/http/request-pipeline.js:109:14)

    at Request.self.callback (/usr/local/azure/node_modules/azure/node_modules/azure-common/node_modules/request/request.js:129:22)

    at Request.EventEmitter.emit (events.js:98:17)

    at Request.<anonymous> (/usr/local/azure/node_modules/azure/node_modules/azure-common/node_modules/request/request.js:873:14)

    at Request.EventEmitter.emit (events.js:117:20)

    at IncomingMessage.<anonymous> (/usr/local/azure/node_modules/azure/node_modules/azure-common/node_modules/request/request.js:824:12)

    at IncomingMessage.EventEmitter.emit (events.js:117:20)

    at _stream_readable.js:920:16

error:   vm create-from commandfailed

----------------------------------------------------------------------------------------------------------------


Any help greatly appreciated :)


Thanks

 - Tim.


Viewing all articles
Browse latest Browse all 12545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>