Question

I erroneously named a virtual machine.

Using the Azure Powershell I am able to rename cloud services using Set-AzureService. There doesn't seem to be a Set-AzureVM command to rename virtual machines.

Is there another way to rename a virtual machine? I do not wish to change the VM's service name.

EDIT, further clarity:

I do NOT want to rename the cloud service name or the machine/computer name in the VM instance. I purely wish to change the associated name that my virtual machine is labeled with. i.e. the name you see in the portal

The names in the column with the red arrow:

enter image description here

Était-ce utile?

La solution

Set-AzureService does not change service name! It only changes deployment name and description. These properties are just kind of Meta-Data associated with the hosted service deployment. You cannot change cloud service name (**cloudservice**.cloudapp.net) by any means! You can only create or delete cloud service.

And, not you can't change VM's name via Azure PowerShell cmdlets, but most probably you can do this by remote power shell to the targeted VM. Please note that renaming a Windows machine always requires restart!

For information on how to use Remote Power Shell on Azure VM, please check out this article.

UPDATE

I think what you need is the UpdateRole action on the management API. It has parameter RoleName which is desribed as:

RoleName
Required. Specifies the name for the virtual machine. The name must be unique within Windows Azure.

And the powershell cmdlet to use is: Update-AzureVM

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top