VPS Host Maintenance Shutdown: Difference between revisions
(Add guide for VPS host maintenance shutdown procedure) |
(Rewrite: streamlined structure, reduced verbosity, simplified diagram) |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:VPS Host Maintenance - Shutdown Procedure}} | {{DISPLAYTITLE:VPS Host Maintenance - Shutdown Procedure}} | ||
[[Category:Administration]] | [[Category:Administration]] | ||
''' | '''Guide for gracefully shutting down a VoIPmonitor VPS from the HOST system for planned hardware maintenance.''' | ||
{{Note|1=This | {{Note|1=This applies to LXC containers on SolusVM hypervisors. For stopping only the VoIPmonitor service (not the VPS), use <code>systemctl stop voipmonitor</code> inside the VPS - see [[Systemd_for_voipmonitor_service_management|Systemd Service Management]].}} | ||
== Overview | == Overview == | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Scenario | ! Scenario !! Commands !! Documentation | ||
|- | |- | ||
| | | Stop VoIPmonitor service only || <code>systemctl stop voipmonitor</code> (inside VPS) || [[Systemd_for_voipmonitor_service_management|Systemd Service Management]] | ||
|- | |- | ||
| | | Shutdown entire VPS for maintenance || <code>lxc-stop</code>, <code>sw vps-detach/attach/start</code> (from HOST) || This guide | ||
|} | |} | ||
<kroki lang="mermaid"> | |||
%%{init: {'flowchart': {'nodeSpacing': 15, 'rankSpacing': 30}}}%% | |||
flowchart LR | |||
A[Stop MySQL] --> B[lxc-stop] --> C[sw vps-detach] --> D[Maintenance] --> E[sw vps-attach] --> F[sw vps-start] --> G[Start MySQL] | |||
</kroki> | |||
== Prerequisites == | == Prerequisites == | ||
* SSH access to the HOST system (not the VPS) | * SSH root access to the HOST system (not the VPS) | ||
* SolusVM tools (<code>sw</code>) and LXC tools installed | |||
* SolusVM | * VPS container name (e.g., <code>sipMON</code>) | ||
* | |||
== | == Shutdown Procedure == | ||
Stop | === Step 1: Stop MySQL on Host === | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
service mysql stop | service mysql stop | ||
ps ax | grep mysqld # Verify stopped | |||
ps ax | grep mysqld | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Tip|1= | {{Tip|1=Skip if MySQL runs on a different host.}} | ||
Stop the | === Step 2: Stop and Detach the VPS === | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Stop | # Stop LXC container | ||
lxc-stop -n sipMON | lxc-stop -n sipMON | ||
# | # Detach from SolusVM | ||
sw vps-detach -n sipMON | sw vps-detach -n sipMON | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Warning|1= | {{Warning|1=Wait for <code>lxc-stop</code> to complete before running <code>vps-detach</code>.}} | ||
=== Step 3: Perform Hardware Maintenance === | |||
Proceed with hardware work (drive replacement, RAM upgrade, etc.). | |||
== Startup Procedure == | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Re-attach | # Re-attach and start VPS | ||
sw vps-attach -n sipMON | sw vps-attach -n sipMON | ||
sw vps-start -n sipMON | sw vps-start -n sipMON | ||
# Verify | # Verify running | ||
lxc-ls -f | lxc-ls -f | ||
# Start MySQL on host | |||
service mysql start | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Note|1=VoIPmonitor | {{Note|1=VoIPmonitor starts automatically if <code>systemctl enable voipmonitor</code> was configured. Any buffered SQL queries (<code>qoq</code> files) will be processed automatically.}} | ||
== Verification == | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# | # Check VPS status | ||
lxc-ls -f | lxc-ls -f | ||
# SSH into VPS and verify VoIPmonitor | |||
# SSH into | |||
ssh root@<VPS_IP> | ssh root@<VPS_IP> | ||
systemctl status voipmonitor | systemctl status voipmonitor | ||
# | # Monitor SQL queue in GUI: Settings → Sensors → Status | ||
# Wait for SQLq to return to 0 | |||
# | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== Troubleshooting == | == Troubleshooting == | ||
=== | === Container Unreachable After Host Power Cycle === | ||
Run the full stop/detach/attach/start sequence: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
lxc-stop -n <container_name> | |||
lxc-stop -n | sw vps-detach -n <container_name> | ||
sw vps-attach -n <container_name> | |||
sw vps-start -n <container_name> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
= | {{Note|1=Allow each SolusVM command to complete before proceeding to the next.}} | ||
=== VPS Will Not Stop === | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Force stop (last resort) | |||
lxc-stop -n sipMON -k | |||
# Force stop | |||
</syntaxhighlight> | </syntaxhighlight> | ||
=== VPS Does Not Start After Re-attach === | === VPS Does Not Start After Re-attach === | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Check | # Check logs | ||
tail -f /var/log/solusvm.log | tail -f /var/log/solusvm.log | ||
tail -f /var/log/lxc/sipMON.log | tail -f /var/log/lxc/sipMON.log | ||
# | # Manual start with foreground output | ||
lxc-start -n sipMON -F | lxc-start -n sipMON -F | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 159: | Line 121: | ||
== AI Summary for RAG == | == AI Summary for RAG == | ||
'''Summary:''' | '''Summary:''' Host-level procedure for gracefully shutting down a VoIPmonitor VPS running in an LXC container on SolusVM hypervisor. Shutdown sequence from HOST: (1) <code>service mysql stop</code>, (2) <code>lxc-stop -n <name></code>, (3) <code>sw vps-detach -n <name></code>. Startup sequence: (1) <code>sw vps-attach -n <name></code>, (2) <code>sw vps-start -n <name></code>, (3) <code>service mysql start</code>. For unplanned host power cycles where container becomes unreachable, use the same stop/detach/attach/start sequence. Verify with <code>lxc-ls -f</code> and monitor SQL queue in GUI. | ||
'''Keywords:''' VPS shutdown, host maintenance, LXC container, SolusVM, lxc-stop, lxc-start, sw vps-detach, sw vps-attach, sw vps-start, hardware maintenance, mysql stop | '''Keywords:''' VPS shutdown, host maintenance, LXC container, SolusVM, lxc-stop, lxc-start, sw vps-detach, sw vps-attach, sw vps-start, hardware maintenance, mysql stop, graceful shutdown, host power cycle | ||
'''Key Questions:''' | '''Key Questions:''' | ||
* How do I shut down a VoIPmonitor VPS from the host system | * How do I shut down a VoIPmonitor VPS from the host system? | ||
* What is the | * What is the correct order for stopping VPS and MySQL? | ||
* How do I recover an LXC container unreachable after host power cycle? | |||
* What SolusVM commands are used for VPS maintenance? | |||
* How do I | * How do I verify VoIPmonitor is running after VPS restart? | ||
* What | |||
* How do I | |||
Latest revision as of 16:47, 8 January 2026
Guide for gracefully shutting down a VoIPmonitor VPS from the HOST system for planned hardware maintenance.
ℹ️ Note: This applies to LXC containers on SolusVM hypervisors. For stopping only the VoIPmonitor service (not the VPS), use systemctl stop voipmonitor inside the VPS - see Systemd Service Management.
Overview
| Scenario | Commands | Documentation |
|---|---|---|
| Stop VoIPmonitor service only | systemctl stop voipmonitor (inside VPS) |
Systemd Service Management |
| Shutdown entire VPS for maintenance | lxc-stop, sw vps-detach/attach/start (from HOST) |
This guide |
Prerequisites
- SSH root access to the HOST system (not the VPS)
- SolusVM tools (
sw) and LXC tools installed - VPS container name (e.g.,
sipMON)
Shutdown Procedure
Step 1: Stop MySQL on Host
service mysql stop
ps ax | grep mysqld # Verify stopped
💡 Tip: Skip if MySQL runs on a different host.
Step 2: Stop and Detach the VPS
# Stop LXC container
lxc-stop -n sipMON
# Detach from SolusVM
sw vps-detach -n sipMON
⚠️ Warning: Wait for lxc-stop to complete before running vps-detach.
Step 3: Perform Hardware Maintenance
Proceed with hardware work (drive replacement, RAM upgrade, etc.).
Startup Procedure
# Re-attach and start VPS
sw vps-attach -n sipMON
sw vps-start -n sipMON
# Verify running
lxc-ls -f
# Start MySQL on host
service mysql start
ℹ️ Note: VoIPmonitor starts automatically if systemctl enable voipmonitor was configured. Any buffered SQL queries (qoq files) will be processed automatically.
Verification
# Check VPS status
lxc-ls -f
# SSH into VPS and verify VoIPmonitor
ssh root@<VPS_IP>
systemctl status voipmonitor
# Monitor SQL queue in GUI: Settings → Sensors → Status
# Wait for SQLq to return to 0
Troubleshooting
Container Unreachable After Host Power Cycle
Run the full stop/detach/attach/start sequence:
lxc-stop -n <container_name>
sw vps-detach -n <container_name>
sw vps-attach -n <container_name>
sw vps-start -n <container_name>
ℹ️ Note: Allow each SolusVM command to complete before proceeding to the next.
VPS Will Not Stop
# Force stop (last resort)
lxc-stop -n sipMON -k
VPS Does Not Start After Re-attach
# Check logs
tail -f /var/log/solusvm.log
tail -f /var/log/lxc/sipMON.log
# Manual start with foreground output
lxc-start -n sipMON -F
AI Summary for RAG
Summary: Host-level procedure for gracefully shutting down a VoIPmonitor VPS running in an LXC container on SolusVM hypervisor. Shutdown sequence from HOST: (1) service mysql stop, (2) lxc-stop -n <name>, (3) sw vps-detach -n <name>. Startup sequence: (1) sw vps-attach -n <name>, (2) sw vps-start -n <name>, (3) service mysql start. For unplanned host power cycles where container becomes unreachable, use the same stop/detach/attach/start sequence. Verify with lxc-ls -f and monitor SQL queue in GUI.
Keywords: VPS shutdown, host maintenance, LXC container, SolusVM, lxc-stop, lxc-start, sw vps-detach, sw vps-attach, sw vps-start, hardware maintenance, mysql stop, graceful shutdown, host power cycle
Key Questions:
- How do I shut down a VoIPmonitor VPS from the host system?
- What is the correct order for stopping VPS and MySQL?
- How do I recover an LXC container unreachable after host power cycle?
- What SolusVM commands are used for VPS maintenance?
- How do I verify VoIPmonitor is running after VPS restart?