How to move vCloud Transfer Directory

VMware’s instructions on how to install multiple vCloud Cells are rather clear, you first create a NFS share and mount that to the location “/opt/vmware/vcloud-director/data/transfer”. Then install both vCloud Cells and you’re done. In a single vCloud Cell install, the cell will use the local disk for the transfer directory. For a multi cell environment this is not the desired configuration, but even in a single cell environment this could get you into troubles when importing large VMs. How to move from a local transfer directory to a NFS shared transfer directory?

First step is to create a NFS Share on a NFS Server. I used a RHEL 5.6 VM to which I attached an extra disk and mounted that disk into the root of the nfs server to “/nfs” and then create a NFS share (NFS export) by editing the “/etc/exports” file:

/nfs *(rw,no_root_squash)

Then restart the NFS daemon to publish this new export:

service nfs restart

I had some issues when trying to get this to work, because I couldn’t figure out the correct options (rw,no_root_squash) but the current setting works.

Switch back to your vCloud Cell for the next step which is to connect this cell to this new location, but since vCloud has stored information in the current /opt/vmware/vcloud-directory/data/transfer directory we need to free this space and copy the contents to a safe place. Let’s not forget to first stop the running vCloud:

service vmware-vcd stop

PRO-TIP: See the comment section for a pro-tip from Roman!
Copy the information to a safe location in /tmp:

cp -r /opt/vmware/vcloud-director/data/transfer/ /tmp/copy-of-transfer

Then delete existing data:

rm -fR /opt/vmware/vcloud-director/data/transfer/*

At this point the NFS share should be mounted using the following command:

mount -t nfs nfs-server.vanzanten.local:/nfs /opt/vmware/vcloud-director/data/transfer

To make sure the share is also mounted after reboot, also edit /etc/fstab:

nfs-server.vanzanten.local:/nfs /opt/vmware/vcloud-director/data/transfer/ nfs rw 0 0

Now copy the information from the /tmp directory into the mounted share:

cp -r /tmp/copy-of-transfer/* /opt/vmware/vcloud-director/data/transfer/

Pay attention the the * to make sure the right level of files is being copied. To check if the copy action was correct, make sure the “cell” directory is in /opt/vmware/vcloud-director/data/transfer/ and not in a subdirectory. Also you’ll notice that the “cells” directory is now owned by root. This is not correct, it should be owned by the user “vcloud”. To fix this run:

chown -R vcloud:vcloud /opt/vmware/vcloud-director/data/transfer/*

The ‘migration’ should now be complete so let’s start the vCloud Cell again and see if everything is alright.

service vmware-vcd start

To follow the progress keep any eye on the cell.log:

tail -f /opt/vmware/vcloud-directory/logs/cell.log

and see the following output:
Successfully bound network port: 443 on host address: 192.168.0.19
Application Initialization: 17% complete. Subsystem ‘com.vmware.vcloud.consoleproxy’ started
Application Initialization: 23% complete. Subsystem ‘com.vmware.vcloud.common-vmomi’ started
Application Initialization: 29% complete. Subsystem ‘com.vmware.vcloud.jax-rs-activator’ started
Application Initialization: 35% complete. Subsystem ‘com.vmware.pbm.placementengine’ started
Application Initialization: 41% complete. Subsystem ‘com.vmware.vcloud.vim-proxy’ started
Application Initialization: 47% complete. Subsystem ‘com.vmware.vcloud.fabric.foundation’ started
Application Initialization: 52% complete. Subsystem ‘com.vmware.vcloud.fabric.storage’ started
Application Initialization: 58% complete. Subsystem ‘com.vmware.vcloud.fabric.compute’ started
Application Initialization: 64% complete. Subsystem ‘com.vmware.vcloud.fabric.net’ started
Successfully verified transfer spooling area: /opt/vmware/vcloud-director/data/transfer <=== YES IT WORKED
Application Initialization: 70% complete. Subsystem ‘com.vmware.vcloud.backend-core’ started
Application Initialization: 76% complete. Subsystem ‘com.vmware.vcloud.ui.configuration’ started
Application Initialization: 82% complete. Subsystem ‘com.vmware.vcloud.imagetransfer-server’ started
Application Initialization: 88% complete. Subsystem ‘com.vmware.vcloud.rest-api-handlers’ started
Application Initialization: 94% complete. Subsystem ‘com.vmware.vcloud.jax-rs-servlet’ started

Now you have migrated the local transfer server location to the NFS share. To prepare for installation of the second cell, copy the response file of the installation of the first cell, from “/opt/vmware/vcloud-director/etc/responses.properties” to the NFS share so you can easily use it for the installation of the second cell. Be sure to remove it from the NFS share after installation because it contains password information.

  • Hello Gabe

    Pro-tip: do not use ‘cp’ for such operations as you will run into issues with changing owners/permissions. So my suggestion to be on the safe side would be this:

    service vmware-vcd stop
    cd /opt/vmware/vcloud-director/data/transfer/
    tar cvf /tmp/transfer.tar .
    rm -rf .
    — leave directory
    — edit fstab as suggested by you
    — check with ‘mount -a’ if it works as expected
    /opt/vmware/vcloud-director/data/transfer
    cd transfer
    tar xvf /tmp/transfer.tar
    service vmware-vcd start

    More “elite” unix-guys would probably may take this approach to prevent having the need of twice the space:

    service vmware-vcd stop
    — mount the nfs-share to a temporary location e.g. /media/nfs:
    mkdir /media/nfs
    mount -t nfs nfs-server.vanzanten.local:/nfs /media/nfs
    cd /opt/vmware/vcloud-director/data/transfer/
    tar cvf – . | (cd /media/nfs ; tar xvf – )
    rm -rf /opt/vmware/vcloud-director/data/transfer/*
    umount mkdir /media/nfs
    — edit fstab as suggested by you
    — check with ‘mount -a’ if it works as expected
    service vmware-vcd start

    Regards
    Roman

  • Thank you for the reply, I will refer to it in the post.