Skip to content

Instantly share code, notes, and snippets.

@sneal
Created July 12, 2023 20:31
Show Gist options
  • Save sneal/923112b058d5dac2cc44f7a29365eefe to your computer and use it in GitHub Desktop.
Save sneal/923112b058d5dac2cc44f7a29365eefe to your computer and use it in GitHub Desktop.
BOSH datastore cluster - datastore evacuation

This topic describes how to change your VMware Tanzu Operations Manager (Ops Manager) installation's underlying vSphere datastore clusters.

Before You Begin

The following sections describe the steps you can do prior to the migration.

Step 1: Back Up Your Environment

Ensure that your Ops Manager environment is fully backed up.

For more information about how to back up Ops Manager, see Backing Up Deployments.

Step 2: Document Current Environment Settings

Document your current environment settings before you proceed with the datastore migration. Record which VMs are running and in which datastore they reside. If you experience any issues during or after the migration, you must have this information to restore your environment.

To obtain this information run the following command:

bosh instances --details > instances.txt

Save the resulting instances.txt file to a safe location. Note the datastore where each VM resides in vSphere.

Step 3: Check System Health

Check the Status tab in your runtime product tiles, such as VMware Tanzu Application Service for VMs (TAS for VMs) and make sure there are no errors or reported issues.

Step 4: Check Installed Products Health

In each tile installed in your Ops Manager deployment, check the Status tab and make sure there are no errors or reported issues.

Step 5: Check BOSH Director Status

To check the status of your BOSH Director:

Verify that there are no pending changes and that the status of all tiles is green.

Make sure the last Installation Log does not contain any errors.

Procedure: Remove Datastore from Datastore Cluster

The following sections describe the steps you can do to execute the migration.

Remove Datastore

  1. Browse to the datastore in the vSphere Client.

  2. Right-click the datastore and select Maintenance Mode > Enter Maintenance Mode. A list of recommendations appears for datastore maintenance mode migration.

  3. (Optional) On the Placement Recommendations tab, deselect any recommendations you do not want to apply.

Note: The datastore cannot enter maintenance mode without evacuating all disks. If you deselect recommendations, you must manually move the affected virtual machines.

  1. If necessary, click Apply Recommendations.

vCenter Server uses Storage vMotion to migrate the virtual disks from the source datastore to the destination datastore and the datastore enters maintenance mode. This could take a number of hours to move all the disks. When enabling datastore maintenance mode, Storage DRS will move virtual machines out of the datastore as fast as it can. The number of virtual machines that can be migrated in or out of a datastore is 8. This is related to the concurrent migration limits of hosts, network and datastores.

Once this is complete the BOSH VMs disk will be moved from the configured pcf_disk folder to their respective VM's storage folder and the disks will be renamed as well. For example from \pcf_disk\disk-43edf7b2-467b-4913-8142-91b24896b482.vmdk to \vm-1983a793-2c33-474d-ad7f-8e24586ccc13\1983a793-2c33-474d-ad7f-8e24586ccc13_4.vmdk.

FAQs

Q - Some VM's won't migrate because of an ISO attached to a CD-ROM A - This CD-ROM contains a json file that is only used on first boot of a BOSH VM to bootstrap the BOSH agent. You can safely disconnect the CD-ROM and set it to client device. This can be scripted like vmotion4bosh does here.

Q - My VM has a VApp property that points to the old persistent disk location. Is this OK? A - The VApp property is just a hint to BOSH when recreating a VM and can be ignored. Since vSphere doesn't know about this property, it didn't get updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment