Skip to content

Changing property 'osDisk.name' is not allowed #7

@juststopping

Description

@juststopping

We ran into an issue with the "AzureRM - Move existing VM to new VNET.ps1" script. The issue kept the VM from being recreated, after it was removed.

New-AzureRmVm : Changing property 'osDisk.name' is not allowed.
ErrorCode: PropertyChangeNotAllowed
ErrorMessage: Changing property 'osDisk.name' is not allowed.
StatusCode: 409
ReasonPhrase: Conflict

We had to comment out line 201 to keep the PowerShell script from attempting to rename the OSDisk's name. It does not appear to be supported. When you comment out the line, the OS Disk's name does not change and the VM is created properly.

Original:
201 $vm.StorageProfile.OSDisk.Name = $vmName
Updated:
201 #$vm.StorageProfile.OSDisk.Name = $vmName

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions