MASS - Starting and Stopping » History » Revision 2
Revision 1 (Gareth Eaton, 12/24/2023 12:55 PM) → Revision 2/5 (Gareth Eaton, 12/24/2023 12:59 PM)
h1. MASS - Starting and Stopping
h3. Stopping Containers
SSH into Proxmox Server: First, you need to SSH into your Proxmox server or access its command line through the console.
List All Running Containers: Use the command pct list to list all running containers. This will give you the IDs of the containers.
Stop Containers: To stop multiple containers, you can use a bash loop. For example:
<pre>
for id in {101..110}; do pct stop $id; done
</pre>
This command stops containers with IDs from 101 to 110. Adjust the range according to your container IDs.
h3. Starting Containers
List All Stopped Containers: If needed, you can list all stopped containers using a command like pct list | grep stopped to identify which ones are not running.
Start Containers: Similarly, to start multiple containers, use a bash loop:
<pre>
for id in {101..110}; do pct start $id; done
</pre>
This will start containers with IDs from 101 to 110.
----
h2. Note:
If container IDs are not in a continuous sequence (they jump from 204 to 300, then to 400), you'll need to handle each range separately.
200 201 202 203 204 300 301 302 310 311 312 313 400 401 402 403
<pre>
for id in {200..204} {300..313} {400..403}; do pct stop $id; done
</pre>
Similarly, to start these containers