VPS Host Maintenance Shutdown

From VoIPmonitor.org


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?