You can stop and start the component TAS for VMs virtual machines that make up your deployment. This article walks you through the steps.
This article assumes you are using BOSH CLI version 2.
In some cases, you may want to stop all your VMs (for example, power down your deployment) or start all of your VMware Tanzu Application Service for VMs (TAS for VMs) VMs (for example, recover from a power outage). You can stop or start all TAS for VMs VMs with a single bosh
command.
If you want to shut down or start up a single VM in your deployment, you can use the manual process described in Stopping and Starting Individual TAS for VMs VMs.
This procedure uses the BOSH Command Line Interface (BOSH CLI). For more information about using this tool, see Advanced Troubleshooting with the BOSH CLI.
This section describes how to stop and start all the VMs in your deployment.
To shut down all the VMs in your deployment:
Scale down the following jobs to one instance:
consul_server
mysql
Run the following command for each of the deployments listed in the previous step:
bosh -e MY-ENV -d MY-DEPLOYMENT stop --hard
Where:
MY-ENV
is the alias you set for the BOSH Director.MY-DEPLOYMENT
is the name of your deployment.For example:
$ bosh -e prod -d mysql stop --hardThis command stops all VMs in the specified deployment. The `--hard` flag instructs BOSH to delete the VMs but retain any persistent disks.
To start all the VMs in your deployment:
Select the product deployment for the VMs you want to shut down. You can run the following command to locate CF deployment manifests:
$ find /var/tempest/workspaces/default/deployments -name cf-*.yml
Run the following command:
bosh -e MY-ENV -d MY-DEPLOYMENT start
Where:
MY-ENV
is the alias you set for the BOSH Director.MY-DEPLOYMENT
is the name of your deployment.For example:
$ bosh -e prod -d mysql start
This command starts all VMs in the specified deployment.
If you require high availability in your deployment, scale up all instance groups to the original or desired counts.
This section describes how to stop and start individual VMs in your deployment.
You need the full names of the VMs to stop and start them using the BOSH CLI. To find full names for the VMs running each component, run bosh -e MY-ENV instances
, replacing MY-ENV
with the alias you set for your BOSH Director. To filter the list of instances by deployment, run bosh -e MY-ENV -d MY-DEPLOYMENT instances
.
For example:
$ bosh -e prod -d mysql instances ... Deployment 'mysql' Instance Process State AZ IPs mysql/0123-abcd-4567ef89 running - 10.244.0.6 mysql/abcd-0123-ef4567ab running - 10.244.0.2 2 instances ...
You can see the full name of each VM in the Instance
column of the terminal output. Each full name includes:
A prefix indicating the component function of the VM.
An identifier string specific to the VM.
For any component, you can look for its prefix in the bosh instances
output to find the full name of the VM or VMs that run it.
To stop a job, run the following command for the component in your TAS for VMs deployment, replacing MY-ENV
with the alias you set for your BOSH Director and MY-DEPLOYMENT
with the name of the deployment:
bosh -e MY-ENV -d MY-DEPLOYMENT stop VM-NAME
To delete the instance that contains the job, run the following command for the component in your TAS for VMs deployment:
bosh -e MY-ENV -d MY-DEPLOYMENT stop VM-NAME --hard
Use the full name of the component VM as listed in your bosh instances
terminal output without the unique identifier string.
For example, the following command stops the Loggregator Traffic Controller job:
$ bosh -e prod -d loggregator stop loggregator_trafficcontroller
To stop a specific instance of a job, include the identifier string at the end of its full name.
For example, the following command stops the Loggregator Traffic Controller job on only one Diego Cell instance:
$ bosh -e prod -d loggregator stop loggregator_trafficcontroller/0123-abcd-4567ef89
To delete the VM, include --hard
at the end of the command. This command does not delete persistent disks.
For example, the following command deletes a specific Loggregator Traffic Controller instance:
$ bosh -e prod -d loggregator stop loggregator_trafficcontroller/0123-abcd-4567ef89 --hard
Run the following command for the component in your TAS for VMs deployment you wish to start, replacing MY-ENV
with the alias you set for your BOSH Director and MY-DEPLOYMENT
with the name of the deployment. Use the full name of the component VM as listed in your bosh vms
terminal output without the unique identifier string.
bosh -e MY-ENV -d MY-DEPLOYMENT start VM-NAME
The following example command starts the Loggregator Traffic Controller VM:
$ bosh -e prod -d loggregator start loggregator_trafficcontroller
To start a specific instance of a VM, include the identifier string at the end of its full name.
For example, the following command starts the Loggregator Traffic Controller job on one Diego Cell instance:
$ bosh -e prod -d loggregator start loggregator_trafficcontroller/0123-abcd-4567ef89