vCloud 5.5.1: Create new storage policy, add storage, migrate vApps.

We recently purchased new storage so the new datastores had to be added to vCloud director, and all the vApps migrated over.  There are many ways to go about doing this but the best solution I found was to create a new storage cluster and put all datastores in it and also create a new storage policy and profile.  I have been told it is also possible to just perform a storage vmotion on the VM’s but i had mixed results with this approach.  Here is my information which I hope might be useful to someone.

In Vcenter server:
  1. Create tag category (I called mine “storage policies” to keep it simple”, but description can also be used to describe the function)
  2. Create tag and add to category
  3. Open VM storage policies
    1. Create new VM storage policy
    2. Select vCenter
    3. Enter a policy name
    4. Provide description
    5. Add tag-based rule and assign newly create tag from tag category.
  4. I ALWAYS FORGET to enable the policy so here is not to you doing the same 🙂
    1. select the new policy name
    2. 2nd icon from left is “Enable VM storage policies per compute resource.
  1. Assign the newly created tag to datastore cluster
  2. Assign the newly created tag to each datastore within the cluster.

In vCloud director:
  1. Under Manage & Monitor tab select vCenters from vSphere resources.
  2. Right click the vCenter server name and select  “refresh storage policies
After you get the storage profile to show in storage policies you have to assign it:
  1. Go to Provider VDC and open it
  2. Select storage policies tab
  3. Add new storage policy! 
  4. There is a BUG in 5.5.1 which does not refresh or show the storage policy and an outage is actually necessary to clean up the database with a script (not very nice but works)
  1. Go to Organizations and open the one which will be using the new storage
  2. Select Virtual datacenter tab
  3. Select Storage policies tab
  4. Add the new storage policy
  5. If you want the new policy to be the default – Right click the new storage policy and select “Set as default”

Migrating vAPPS to new storage profile:

  • The best method I found was to shutdown the vAPP and right click select “move to” and then each individual VM select the new storage policy.
  • You can also do this with a powered on VM and go to properties and change the storage polic

Assigning Storage Profile/Policy: Difference between vSphere client and web client

The vSphere client makes use of the following terminology:
Storage profile
Storage capabilities

The vSphere web client makes use of the following terminology:
Storage policy
Rule-Set through TAGS

The main thing to take note of here is that Storage capabilities created in vSphere client is migrated over to TAGS within vSphere Web client.  These tags are then assigned to the VM Storage Policy through the rule-set.


vCloud Director – Migration of storage to new storage profile

Migration from local direct attached storage on single ESXi host to more flexible environment with multiple ESXi host with new shared storage profile.
Some considerations:
  • The migration will create full clone VMs on new storage profile so please take the storage usage into consideration before starting the move.  Look at thin provisioning on VMs hard disk.
  • Can you afford to shut down the VMs or not for migration, this will affect your effort.
  • Just not vAPPs needs to be moved, also remember your vAPP templates and media.  I would start with the vAPPs and media first.

Within vSphere client:
Go to VM storage profiles (normally accessible from the main home screen on both regular and web client.
Select “Manage storage capabilities”
Create a new storage capability and provide name
Select “Create VM storage profile”
Provide name
Select the storage capability just created before
Create storage cluster within the datacenter which is assigned to your Provider VDC.
Add the shared storage datastores to the cluster.
Verify that all the datastores are seen by the ESXi hosts.
Very important, and i have forgotten this which will cause users to be unable to deploy vAPPS:

  • Within Vcenter client select the datastore, right click and select “Assign User-defined storage     capabilities” 
  • From drop down select the previously created storage capability.
These datastores should now be visible within vCloud director.
Within vCloud director:
There are a few ways to migrate your vAPPS over to the new storage profile, which is really refreshing to see multiple options and this certainly did become very useful for us since there is a bug in vcloud for making use of the “move to” feature and your IP/Mac addresses are not retained. 
(Previous post describes the symptoms and workaround)
Taking the above bug into consideration for retaining MAC/IP, and the different workload involved with each here are the ways to migrate over.
Method 1:
Take into consider that in my version when you perform this task it will not retain the MAC/IP source addresses and if you have NAT’s configured for VM’s on the Edge gateway this will not work anymore and you have to recreate these with new ORG ip assigned to VM.  Subsequent version will probably have this resolved so not an issue. Run a test before moving production vAPPs!
1. Shut down your vAPP, right click and select “move to”.
2. Next to each VM, click drop down box and change the storage profile to the newly created.
3. Perform this for each VM and select OK
4. Done, and super easy!
5. The same steps can be used for vAPP templates and media.
Method 2:
This method requires a lot more effort but also find that you can do perform a hot storage vmotion, which means you don’t have to shut down the VM.  It will also retain the MAC/IP address of ORG VDC network. 
1. Open the vAPP.
2. Select the VM properties.
3. Under General tab scroll down to bottom and select from drop down the new storage profile
4. This will perform a storage vMotion on the backend which can be observed from vSphere client.
5. Perform this task on each VM.
This will however only move over the VM’s… the vSE (vShield Edge) VM which serves the network for the vAPP does not get moved over, so you have to do this manually through the vsphere client with storage vmotion.  ( NOTE: I perform this task with the supervision of VMware support and they do require that you have the latest versions of ESXi and Vcenter server installed. Perform at own risk and I take no responsibility but this worked perfect for me without any problems.  Versions I currently have installed:
a. vCenter server 5.1.0 1123961
b. vCloud director
c. ESXi 5.1.0 1157734
Interesting result and resolution:
After I moved all my vAPPS, vAPP templates I reviewed the old datastores with Lctree application tool and it showed no VM’s anymore on the datastore, BUT when i go to vsphere client and look at datastore it shows a bunch of VM’s still associate to the what is going on?
After some debugging I found that it is only the media files which are still linked to the VM as an ISO.  Just eject the CD/floppy from virtual machine by right click on VM within vCloud director.  

A great tool to use to view the linked clones and any VM’s still on old storage profile datastores.