locked
Can't stop Virtual Machine RRS feed

  • Question

  • My virtual machine can not be stopped(deallocate).

    PS C:\> Get-AzureRmVM -ResourceGroupName xxxx -Name xxxx | Stop-AzureRmVM -Force
    Stop-AzureRmVM : Long running operation failed with status 'Failed'.
    ErrorCode: CannotAddOrRemoveNetworkInterfacesFromARunningVirtualMachine
    ErrorMessage: Secondary network interfaces cannot be added or removed from a running virtual machine. Hence, adding or removing the network interfaces /subscriptions/zzzzzz/resourceGroups/yyyy/providers/Microsoft.Compute/virtualMachines/xxxx from the running virtual machine /subscriptions/zzzzzz/resourceGroups/xxxx/providers/Microsoft.Network/networkInterfaces/yyyy is not supported.

    The same error will occur even if the operation in the Azure Portal.

    I’m desperate for advice!

    Thank you

    Thursday, October 27, 2016 4:58 PM

Answers

  • I found solution.

    http://mrautomaton.com/2016/10/25/azure-iaas-disk-add-error/


    PS C:\> $vm = Get-AzureRmVM -ResourceGroupName xxxx -Name yyyy
    PS C:\> $vm.NetworkProfile.NetworkInterfaces[0].Primary = $true
    PS C:\> Update-AzureRmVM -ResourceGroupName mscrm -VM $vm


    • Proposed as answer by Sapna Girish Friday, October 28, 2016 8:27 AM
    • Marked as answer by Sapna Girish Friday, October 28, 2016 8:27 AM
    Thursday, October 27, 2016 7:45 PM