Migrating disks for BOSH and Cloud Foundry (CF) VMs from the current datastore(s) to new datastore(s) can be painless if you do it right. Otherwise, you may end up losing your persistent disks and then your mind.
The following steps will help you avoid unnecessary pain during this process.
1) Attach the new datastore(s) to the hosts where the BOSH and CF VMs are running (Do not detach the old datastores at this time)
2) Change deployment manifest for the BOSH Director to configure vSphere CPI to
reference new datastore(s)
properties: vsphere: host: your_host user: root password: something_secret datacenters: - name: BOSH_DC vm_folder: sandbox-vms template_folder: sandbox-templates disk_path: sandbox-disks datastore_pattern: '\new-sandbox\z' # <--- persistent_datastore_pattern: '\new-sandbox\z' # <--- clusters: [SANDBOX]
3) Redeploy the BOSH Director. Depend on how you deploy the BOSH director, the command you run in this step can vary.
4) Verify that the BOSH Director VM’s root, ephemeral and persistent disks are all
now on the new datastore(s)
bosh deploy --recreate for CF deployments so that VMs are recreated and
persistent disks are reattached
6) Verify that the persistent disks and VMs were moved to new datastore(s) and
there are no remaining disks in the old datastore(s)