Stopping and Starting Virtual Machines
Page last updated:
Warning: Pivotal Cloud Foundry (PCF) v2.4 is no longer supported because it has reached the End of General Support (EOGS) phase as defined by the Support Lifecycle Policy. To stay up to date with the latest software and security updates, upgrade to a supported version.
Page last updated:
This topic assumes you are using BOSH CLI version 2.
This topic describes stopping and starting the component virtual machines (VMs) that make up a Pivotal Cloud Foundry (PCF) deployment.
In some cases you may want to stop all your VMs (for example, power down your deployment) or start all of your PAS VMs (for example, recover from a power outage.) You can stop or start all PAS 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 on this page.
This procedure uses the BOSH Command Line Interface (BOSH CLI). See Advanced Troubleshooting with the BOSH CLI for more information about using this tool.
Stopping and Starting All PAS VMs
This section describes how to stop and start all the VMs in your deployment.
Stopping All PAS VMs
To shut down all the VMs in your deployment, perform the following steps:
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
Replace the text above with the following:MY-ENV
: the alias you set for the BOSH Director.MY-DEPLOYMENT
: the name of your deployment.
For example:
$ bosh -e prod -d mysql stop --hard
This command stops all VMs in the specified deployment. The--hard
flag instructs BOSH to delete the VMs but retain any persistent disks.
Starting All PAS VMs
Perform the following steps 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
Replace the text above with the following:MY-ENV
: the alias you set for the BOSH Director.MY-DEPLOYMENT
: 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.
Stopping and Starting Individual PAS VMs
This section describes how to stop and start individual VMs in your deployment.
Find the Names of Your PAS Virtual Machines
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.
Stopping an Individual PAS VM
To stop a job, run the following command for the component in your PAS 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 PAS 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
Starting an Individual PAS VM
Run the following command for the component in your PAS 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