In order to vMotion VMs from a cluster with a newer CPU architecture to a cluster with an older CPU architecture (downgrade) requires that we set an EVC mode that is compatible with the older target cluster CPU architecture. Downgrading a VM's supported CPU feature set requires that we set an EVC mode on each VM so as to not impact the VMs that are staying on the source cluster. To set a per VM EVC mode on a BOSH deployment requires that we use a modified BOSH CPI and upgrade each VM's hardware version to 14 or higher.
In a vSphere environment, the default VM hardware version for any VM deployed by BOSH is version 9 (ESXi 5.5). This article describes how to force the BOSH Director to upgrade the VM hardware version to the highest level compatible with the ESXi host and set a per VM EVC mode. This is a required prerequisite to vMotion VMs to an older vSphere cluster using the vMotion Migration for BOSH Deployments tool.
You will need to modify the BOSH director configuration via the Operations Manager API and the BOSH CPI directly on the BOSH director VM via SSH. These instructions will modify the BOSH director CPI code directly on the BOSH VM, so if you upgrade Operations Manager or redeploy the BOSH director the BOSH CPI patch will be removed. Do not remove the CPI patch until your foundation has been migrated to the new vSphere cluster and apply changes has run successfully.
- Install the OM CLI tool on your workstation or jumpbox and set the following environment variables to match your TAS foundation:
export OM_TARGET="opsman.example.com"
export OM_USERNAME=admin
export OM_PASSWORD="$ecret"
export OM_SKIP_SSL_VALIDATION=true
export DIRECTOR_IP='192.168.1.5'
- Backup the latest director configuration properties:
om curl -p /api/v0/staged/director/properties > director-props.json
- Set the upgrade hardware flag to true:
om curl -p /api/v0/staged/director/properties \
-x PUT \
-d '{"iaas_configuration":{"additional_cloud_properties":{"upgrade_hw_version":true}}}'
- From your workstation or jumpbox grab the SSH key from the Operations Manager Director tile.
om credentials -p p-bosh -c .director.bbr_ssh_credentials -f private_key_pem > ~/.ssh/bbr.key && chmod 0400 ~/.ssh/bbr.key
- From your workstation or jumpbox that has internet access download the BOSH CPI patch to the BOSH director.
wget -O - --no-check-certificate \
https://gist.githubusercontent.com/sneal/6f77d2278c1234eca9fa1d6e49795c10/raw/3d4f8ab30b80e6910473d1e247d1b0bcfd19e168/evc.patch | \
ssh -i ~/.ssh/bbr.key "bbr@$DIRECTOR_IP" 'cat > /home/bbr/evc.patch'
- From your workstation or jumpbox apply the patch to the BOSH Director's CPI:
ssh -t -i ~/.ssh/bbr.key "bbr@$DIRECTOR_IP" "sudo sh -c 'cd /var/vcap/jobs/vsphere_cpi/packages/vsphere_cpi; patch -p1 -i /home/bbr/evc.patch'"
- From your workstation or jumpbox enable the recreate all VMs option while also disabling recreate the BOSH director VM:
om curl -x PUT -p '/api/v0/staged/director/properties' \
-d '{ "director_configuration": { "bosh_director_recreate_on_next_deploy": false, "bosh_recreate_on_next_deploy": true }}'
-
For any on-demand service tiles you have installed make sure you enable any upgrade errands.
-
Execute apply changes ensuring to recreate all the VMs in the foundation:
om apply-changes
Login to the vSphere GUI and find the TAS installation's Operations Manager VM and BOSH Director VM. Apply the below process to both VMs.
-
Right click on the VM and select Compatibility | Schedule VM Upgrade Compatibility. Select Yes. Select ESXi 6.7 U2 and later. Click OK.
-
Reboot the VM. Right click on the VM and select Power | Restart Guest OS. Click Yes.
-
After the VM finishes rebooting, ensure the VM's compatibility now says "ESXi 6.7 U2 and later (VM version 15)"
-
Power down the VM. Right click on the VM and select Power | Shutdown Guest OS. Click Yes.
-
Select the VM's Configure tab | VMware EVC. If it doesn't show up click the Refresh button in the GUI. Click Edit | Enable EVC for Intel® hosts. Change CPU mode to Intel Sandy Bridge Generation. Click OK.
-
Power up the VM. Right click on the VM and select Power | Power On.
-
For the Operations Manager VM don't forget to login to the GUI and decrypt the installation.