none
Moved VM to different Resource Group but unable to change the SUBNET/ADD New NIC of New Subnet of new Resource Group. RRS feed

  • Question

  • Hello All,

    I have a VM with OLD Resource Group with Address Space 192.168.0.0/16 and subnet as 192.168.2.0/24. My plan was to move the VM to different Resource Group with different Subnet of 192.168.3.0/24 so it gets an ip of 192.168.3.5 as per the subnet.

    So i've created a new Resource Group with Address space 192.168.3.0/24 and subnet as 192.168.3.0/28. I moved VM, its associated NIC and the Associated NSG. So i assumed that it will get New IP address range of 192.168.3.0. But the VM's NIC is still showing that old VNET is associated to it on the portal.

    I tried following steps to get new Subnet IP's.

    Created New NIC of new Subnet with New NSG but cannot attach the same to Moved VM. There is no option to change the VNET.

    I moved that VNET to new RG but i am still not able to add another NIC from Different VNET.

    The Only Solution i see is to Create a new VM in NEW RG with the NEW NSG and SWAP the OS Disk. Or Backup the VM from old VNET and Restore the VM to NEW VNET.


    Unable to Add New NIC with new Vnet as i cannot switch to Vnet

    VM on new RG, New NSG but still on OLD-VNET and old Subnet

    Moved VM Network Details


    akshay8043

    Sunday, September 15, 2019 10:50 AM

Answers

  • Hi, 

    When you move the VM to another resource group, the VNET is not changed. Your VM still connected to that VNET where it is initially deployed. 

    Resource Group is just a container where you can deploy resources. Those resources can be in the same region or may be of different region. But in your case when you tried to change the VM to a different Resource Group, your VM is still linked to the same VNET and hence you are not allowed to attach NIC which is from a different VNET. 

    As you mentioned, the only way is to delete the VM and create a new VM in different VNET in different RG as you desired. 

    Let me know if you have any further questions. 

    Regards, 

    Msrini

    Sunday, September 15, 2019 5:14 PM
    Moderator

All replies

  • Hi, 

    When you move the VM to another resource group, the VNET is not changed. Your VM still connected to that VNET where it is initially deployed. 

    Resource Group is just a container where you can deploy resources. Those resources can be in the same region or may be of different region. But in your case when you tried to change the VM to a different Resource Group, your VM is still linked to the same VNET and hence you are not allowed to attach NIC which is from a different VNET. 

    As you mentioned, the only way is to delete the VM and create a new VM in different VNET in different RG as you desired. 

    Let me know if you have any further questions. 

    Regards, 

    Msrini

    Sunday, September 15, 2019 5:14 PM
    Moderator
  • Any update on this issue?

    If the above helped please remember to "Up-vote" and "Mark as Answer" so others in the community can benefit

    Friday, September 20, 2019 11:39 PM
    Moderator
  • Hello Akshay,

    Any update on this issue?

    If the suggested answer helped you solve your issue, please remember to "Mark as Answer" and "Up-Vote"so others in the community can benefit from it.

    Thanks.
    Tuesday, September 24, 2019 5:52 AM
    Moderator