forked from cloudfoundry/docs-cf-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-stop-vms.html.md.erb
151 lines (100 loc) · 6.37 KB
/
start-stop-vms.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---
title: Stopping and Starting Virtual Machines
owner: BOSH
---
<strong><%= modified_date %></strong>
_This topic assumes you are using [BOSH CLI version 2](https://bosh.io/docs/cli-v2.html)._
This topic describes stopping and starting the component virtual machines (VMs) that make up a <%= vars.first_product_name %> deployment.
In some cases you may want to stop all your VMs (for example, power down your deployment) or start all of your <%= vars.product_short %> VMs (for example, recover from a power outage.) You can stop or start all <%= vars.product_short %> 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](#manual) described on this page.
This procedure uses the BOSH Command Line Interface (BOSH CLI). <%= vars.bosh_cli_link %>
## <a id='startstop'></a>Stopping and Starting All <%= vars.product_short %> VMs
This section describes how to stop and start all the VMs in your deployment.
### <a id='stop_all'></a> Stopping All <%= vars.product_short %> VMs
To shut down all the VMs in your deployment, perform the following steps:
1. Scale down the following jobs to one instance:
* consul\_server
* mysql
<% if vars.product_name == 'CF' %>* etcd\_tls\_server<%else%><%end%>
1. Run the following command for each of the deployments listed in the previous step:
<pre>
bosh -e MY-ENV -d MY-DEPLOYMENT stop --hard
</pre>
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:
<pre class="terminal">
$ bosh -e prod -d mysql stop --hard
</pre>
This command stops all VMs in the specified deployment. The `--hard` flag instructs BOSH to delete the VMs but retain any persistent disks.
### <a id='start_all'></a> Starting All <%= vars.product_short %> VMs
Perform the following steps to start all the VMs in your deployment:
1. Select the product deployment for the VMs you want to shut down. You can run the following command to locate CF deployment manifests:
<pre class="terminal">
$ find /var/tempest/workspaces/default/deployments -name cf-*.yml
</pre>
1. Run the following command:
<pre>
bosh -e MY-ENV -d MY-DEPLOYMENT start
</pre>
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:
<pre class="terminal">
$ bosh -e prod -d mysql start
</pre>
This command starts all VMs in the specified deployment.
1. If you require [high availability](../concepts/high-availability.html) in your deployment, scale up all instance groups to the original or desired counts.
## <a id='manual'></a>Stopping and Starting Individual <%= vars.product_short %> VMs
This section describes how to stop and start individual VMs in your deployment.
### <a id='get-names'></a>Find the Names of Your <%= vars.product_short %> 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:
<pre class="terminal">
$ 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
...
</pre>
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.
### <a id='stop'></a>Stopping an Individual <%= vars.product_short %> VM##
To stop a job, run the following command for the component in your <%= vars.product_short %> deployment, replacing `MY-ENV` with the alias you set for your BOSH Director and `MY-DEPLOYMENT` with the name of the deployment:
<pre>bosh -e MY-ENV -d MY-DEPLOYMENT stop VM-NAME</pre>
To delete the instance that contains the job, run the following command for the component in your <%= vars.product_short %> deployment:
<pre>bosh -e MY-ENV -d MY-DEPLOYMENT stop VM-NAME --hard</pre>
Use the full name of the component VM as listed in your `bosh instances` [terminal output](#term-bosh-vms) without the unique identifier string.
For example, the following command stops the Loggregator Traffic Controller job:
<pre class='terminal'>
$ bosh -e prod -d loggregator stop loggregator_trafficcontroller
</pre>
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:
<pre class="terminal">
$ bosh -e prod -d loggregator stop loggregator_trafficcontroller/0123-abcd-4567ef89
</pre>
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:
<pre class="terminal">
$ bosh -e prod -d loggregator stop loggregator_trafficcontroller/0123-abcd-4567ef89 --hard
</pre>
### <a id='start'></a>Starting an Individual <%= vars.product_short %> VM ##
Run the following command for the component in your <%= vars.product_short %> 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](#term-bosh-vms) without the unique identifier string.
<pre>bosh -e MY-ENV -d MY-DEPLOYMENT start VM-NAME</pre>
The following example command starts the Loggregator Traffic Controller VM:
<pre class="terminal">
$ bosh -e prod -d loggregator start loggregator_trafficcontroller
</pre>
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:
<pre class='terminal'>
$ bosh -e prod -d loggregator start loggregator_trafficcontroller/0123-abcd-4567ef89
</pre>