Dec 17 2013

Move vCloud Director based VM between vSphere clusters

A customer contacted me a few days ago and wanted a operational procedure for moving a vCloud Director (vCD), version 5.5, based virtual machine (VM) from one vSphere cluster to another vSphere cluster. My customer uses vSphere version 5.5 and had one major requirement that had to be taken into account.

The VM has to be powered on when it is being moved.

This blog post is divided into two sections, the first one will present the vCD and vSphere setup and the second one will present the solution.
The pictures are form my test environment where i created a copy of my customers environment.

vSphere and vCD setup

The vSphere (version 5.5) layer consists of 2 vSphere clusters:
Screen Shot 2013-12-17 at 07.44.27

vSphere cluster VCDX56-02-VCD01 consists of the ESXi hosts:

  • Bimini01
  • Bimini02

vSphere cluster VCDX56-02-VCD02 consists of the ESXi hosts:

  • Bimini03
  • Bimini04

My customers production environment only presents datastores per vSphere cluster. and to simplify the blog post there is only one datastore available per vSphere cluster.

  • vSphere cluster VCDX56-02-VCD01 got access to Datastore DS-Cloud-01.
  • vSphere cluster VCDX56-02-VCD02 got access to Datastore DS-Cloud-02.

The datastore:

  • DS-Cloud-01 is addressed in vCD via the Storage Policy SP-Cloud-01.
  • DS-Cloud-02 is addressed in vCD via the Storage Policy SP-Cloud-02.

There is one vCD Provider Virtual Datacenter (PvDC) created, PvDC-01 and it is connected to both the vSphere clusters.
Screen Shot 2013-12-06 at 07.59.54

vCD is configured to allow the vCD allocation model Allocation Pool to be elastic meaning my Org vDC can place VMs on both vSphere clusters.Screen Shot 2013-12-06 at 08.38.46


In this case i had to create one additional datastore, named DS-Cloud-Shared-01, and present the it to both vSphere clusters . This will make it possible to move a VM form one vSphere cluster to the other without turning the VM off.
The DS-Cloud-Shared-01 datastore is addressed in vCD via the Storage Policy SP-Cloud-Shared-01.

The PvDC have access to three datastores:
Screen Shot 2013-12-06 at 08.22.17

The Org vDC has access to the same datastores as the PvDC:
Screen Shot 2013-12-06 at 08.25.22

The VM i wanted to move is called VM-11.
Screen Shot 2013-12-06 at 08.59.00
It was originally placed in vSphere cluster VCDX56-02-VCD02  (ESXi host bimini04) and on the datastore DS-Cloud-02 addressed via the vCD Storage Policy SP-Cloud-02.
Screen Shot 2013-12-15 at 09.56.16

The move between the vSphere clusters is carried out using vCD, no interaction to vCenter Server.

These are the necessary steps:

  1. Change the VM-11 Storage policy in vCD from “SP-Cloud-02”
    Screen Shot 2013-12-15 at 09.41.01
    To the shared Storage Policy “SP-Cloud-Shared-01”.
    Screen Shot 2013-12-06 at 09.02.54
    This will initiate a vCenter Server Storage vMotion and the VM will be placed on the datastore, in my case DS-Cloud-Shared-01, reachable by both vSphere clusters.
    In vCD you can now verify that the VM is located on the DS-Cloud-Shared-01 datastore using Storage Policy SP-Cloud-Shared-01 and still runs on ESXi host bimini04.
    Screen Shot 2013-12-15 at 09.46.13
  2. Initiate a vMotion operation for the VM from within vCD by right-click the VM and select “Migrate To”.
    You will only find this menu option from the System section of vCD. Select System -> vSphere Resources -> Resource Pools -> VCDX56-02-VCD02 (vSphere cluster where the VM is located)
    Screen Shot 2013-12-14 at 09.45.02
  3. Select the destination Resource pool, vSphere cluster in my case, VCDX56-01-VCD01.
    Screen Shot 2013-12-06 at 09.05.56
    vCD shows that the VM is placed on an ESXi host, bimini01, in vSphere cluster VCDX56-02-VCD01.
    Screen Shot 2013-12-15 at 09.48.12
  4. The last thing you need to do now is to initiate a new storage vMotion by changing the destination Storage Policy, SP-Cloud-01.
    Screen Shot 2013-12-15 at 09.42.18

When this task is completed you have moved the VM, VM-11, from:

  • vSphere cluster:
    VCDX56-02-VCD02 to VCDX56-02-VCD01
  • vSphere Datastore:
    DS-Cloud-02 to DS-Cloud-01 via DS-Cloud-Shared-01
  • vCD Storage Policy:
    Sp-Cloud-02 to SP-Cloud-01 via SP-Cloud-Shared-01Screen Shot 2013-12-15 at 20.35.39

When changing storage policy you’ll receive an error saying “This VM has a compliance failure against its Storage Profile”
This is because the it takes some time for the storage policy to change for the VM in vCenter Server, actually the time it takes for the storage vMotion to complete. Verify that the storage profile has change on the vCenter Server VM level and you can safely clear this VM specific error message in vCD.
Screen Shot 2013-12-06 at 09.22.31

Screen Shot 2013-12-06 at 09.27.34


1 ping

Skip to comment form

  1. tushartopale

    Just one mistake in you blog; in the summary:

    vSphere cluster:
    VCDX56-02-VCD01 to VCDX56-02-VCD02

    Should’ve been:
    vSphere cluster:
    VCDX56-02-VCD02 to VCDX56-02-VCD01

  2. magander3

    Thanks for pointing that out. Have change the text now.

  3. tushartopale

    Sure Mag! Hope you didn’t mind me pointing that..

    Excellent work though. Thanks

  4. magander3

    Not at all. Thanks again


    Oh you’re welcome. Thanks

  6. Mike

    Has anyone been able to script this procedure? I’ve worked with powercli to do mass migrations such as this but without vCloud Director in play. I’m looking to perform a similar cluster migration en mass with vCloud Director in the mix through a similar script mechanism.


  7. magander3

    i have not done that with vCD unfortunately but maybe we can work together to create such a procedure. What time are you looking at?


  8. Celia

    Is this a VMware supported procedure?

  9. magander3

    as far as i know this was the only way to accomplish this for this version of vCD so i assume it is supported.


  10. Sohill

    Hi Magnus,
    When you move or migrate vms between 2 clusters, is it treat it from vCenter as normal vmotion when receiving the order from vCD?

  11. Sohill

    Hi Magnus,

    I not sure if my previous reply been sent please ignore this one if you receive it.

    you wrote “nitiate a vMotion operation for the VM from within vCD by right-click the VM and select “Migrate To”
    when you migrate from VCD is it apear and behave as a normal vMotion in vCenter ?

    Thank you

  1. Move vCloud Director based VM between vSphere clusters | tushartopale

    […] Move vCloud Director based VM between vSphere clusters. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">