Re: [vserver] Moving VServers from one host to another

From: Mike O'Connor <vserver_at_pineview.net>
Date: Sat 09 Nov 2013 - 08:10:16 GMT
Message-ID: <527DEDE8.60107@pineview.net>

Hi All

This is a script we have been using for a long time to move vserver guests.

Hopefully this might help

Mike
> I've found it useful to use the --numeric-ids switch on rsync when you
> moving the guests data.
#!/bin/bash
VS=$1
DST=$2

# Syncing ${VS} guest directory to ${DST}
rsync --delete -aPSvx --numeric-ids /vservers/$VS/* root@$DST:/vservers/$VS

# Copying ${VS} config to ${DST}
rsync --delete -aPSvx --numeric-ids /etc/vservers/$VS/*
root@$DST:/etc/vservers/$VS

# Syncing ${VS} guest directory to ${DST}
rsync --delete -aPSvx --numeric-ids /vservers/$VS/* root@$DST:/vservers/$VS

# Syncing ${VS} guest directory to ${DST} again
vserver ${VS} stop
rsync --delete -aPSvx --numeric-ids /vservers/$VS/* root@$DST:/vservers/$VS

ssh root@$DST "echo default > /etc/vservers/$VS/apps/init/mark"
echo none > /etc/vservers/$VS/apps/init/mark

ssh root@$DST "vserver ${VS} start"
Received on Sat Nov 9 08:10:30 2013

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Sat 09 Nov 2013 - 08:10:30 GMT by hypermail 2.1.8