Migrating VM's between vCenter Datacenters.

Discussion in 'Virtualized Computing' started by ManateeMatt, Nov 22, 2012.

  1. ManateeMatt

    ManateeMatt Limp Gawd

    Messages:
    145
    Joined:
    May 27, 2009
    I was wondering if there was a better way of doing this then what im currently doing.

    I have now have 2 Datacenters (one is now PROD, and the other is DEV/QA) in my vCenter server and I need to move some VM's between them. I thought about doing different clusters, but as we are using vDS I rather not have all the useless networks that DEV and QA make end up in my prod environment. I have shared storage between the 2 datacenters till I get my Production equipment off of the DEV/QA system

    The way I'v been doing it is powering down the VM, associating the VM with Prod datacenter, fixing the networks, then powering it on, then removing the VM from inventory on the DEV system. Is this the correct way? or is there a better plan?

    My vCenter server is running 5.1, and all my hosts are running ESXi 5.1 as well. the networking for vMotion, FT, and management are the same in both Datacenters.
     
  2. vektor777

    vektor777 n00b

    Messages:
    15
    Joined:
    Jan 28, 2009
    Do both PROD and DEV/QA environment in the same vCenter?
    Do the source ESXi server and destination ESXi server both see the same storage this VM lives on?

    If yes to both you should be able to vMotion the VM live from one DC to another, but you will first need to disconnect the network adapters, unless you want to make Network groups/names with the same name as the source networks, on the destination data center that mimic the Prod, to support a live vMotion, the Port Groups just need to have the same name as the source.
     
  3. tonyb

    tonyb Limp Gawd

    Messages:
    130
    Joined:
    Dec 30, 2010
    One issue to keep an eye out for is the trombone effect. If you move a VM from one datacenter to another, what's its outgoing default gateway? Still in the old data center? All traffic destined for the VM will traverse the DCI, and return traffic will go back out through the DCI.

    Here's a great video by the venerable Ivan Pepelnjak on the subject:

    http://blog.ioshints.info/2011/11/busting-layer-2-data-center.html
     
  4. ManateeMatt

    ManateeMatt Limp Gawd

    Messages:
    145
    Joined:
    May 27, 2009
    Yes and Yes.

    I are working with just vCenter separated Datacenters not 2 different physical datacenters, the servers them selfs are in the same rack, and same layer 2 networks. IE

    Code:
    vCenter Server
    |-PROD
    |  |-Cluster one
    |      |--host1
    |      |--host2
    |      |--host3
    |-DEV/QA
      |-DEV Cluster
           |--host1
           |--host2
           |--host3
    It appears that I am unable to do a live migration from either the DEV/QA to Prod or PROD to dev/qa. If I try while the vm is off (cold?) I can see the option to move between clustes, but I get this super helpful error of "The input arguments had entities that did not belong to the same datacenter." Any ideas?
     
  5. Child of Wonder

    Child of Wonder 2[H]4U

    Messages:
    3,269
    Joined:
    May 22, 2006
    You cannot live vMotion between logical datacenters inside vCenter.

    Since these clusters are in the same physical datacenter, why do you have them in separate logical datacenters in vCenter? You should have a datacenter object in vCenter to denote your physical datacenter and then both your Prod and Dev clusters under that. Then you can vMotion between the two clusters so long as you have matching port group names configured on each and shared storage.
     
  6. ManateeMatt

    ManateeMatt Limp Gawd

    Messages:
    145
    Joined:
    May 27, 2009
    I didn't think I could live vMotion between logical Datacenters, but I wanted to check anyway. I thought you could do cold migrations thought. As for using the 2 clusters, same logical Datacenter, and using vDS, wouldn't all the networks that are creating vDS show up across the 2 clusters? I rather this didn't happen as In DEV/QA they love there networks, and Edge firewalls.
     
  7. Child of Wonder

    Child of Wonder 2[H]4U

    Messages:
    3,269
    Joined:
    May 22, 2006
    To do a live vMotion between clusters they'll both have to be on the same VDS since you can't create two VDS's in the same datacenter and create a port group in each VDS with the same name.

    If you don't want to do that, your quickest option is to create a standard vSwitch on each host in each cluster, name it "Transfer" or something to that effect, and assign that vSwitch no host network adapters. When you're ready to transfer a VM from one cluster to the other you first assign the VM's network adapter to the "Transfer" port group then migrate it to the other cluster and change the network adapter to the correct port group on the new cluster.

    I figured this would even work across datacenters but got the same error you did. To get past it, I also chose to move the VM files to a new datastore, selected Advanced, then left everything in its current location. That allowed me to get past the error and complete the cold migration.
     
  8. ManateeMatt

    ManateeMatt Limp Gawd

    Messages:
    145
    Joined:
    May 27, 2009
    Thank you, that worked! saved me a lot of manual work!