This feature is available with bosh-vsphere-cpi v9+.
This topic describes how to migrate VMs and persistent disks from one datastore to another without downtime.
Attach new datastore(s) to the hosts where the VMs are running while keeping the old datastore(s) attached to the same hosts.
Change deployment manifest for the Director to configure vSphere CPI to reference new datastore(s).
properties: vsphere: host: 172.16.68.3 user: root password: vmware datacenters: - name: BOSH_DC vm_folder: prod-vms template_folder: prod-templates disk_path: prod-disks datastore_pattern: '\Anew-prod-ds\z' # <--- persistent_datastore_pattern: '\Anew-prod-ds\z' # <--- clusters: [BOSH_CL]
Redeploy the Director
Verify that the Director VM's root, ephemeral and persistent disks are now on the new datastore(s).
For each one of the deployments managed by the Director (visible via
bosh deployments), run
bosh deploy --recreateso that VMs are recreated and persistent disks are reattached.
Verify that the persistent disks and VMs were moved to new datastore(s) and there are no remaining disks in the old datastore(s).