среда, 29 апреля 2015 г.

Move your server* to openvz container


Really simple, as usual. What you need:
1) Proxmox(or any other openvz web-frontend)
2) rsync
So basically these 6 steps:
1) Create new container (or create new config in /etc/vz/conf/)
2) Remove all the files in /var/lib/vz/private/ID/
3) Do initial rsync:
rsync -av --numeric-ids --exclude=/boot/* --exclude=/lib/modules/* --exclude=/tmp/* \
 --exclude=/etc/blkid --exclude=/etc/mtab --exclude=/etc/lvm --exclude=/etc/fstab \
 --exclude=/etc/udev --exclude=/proc/* --exclude=/sys/* --exclude=/dev/* \
root@REMOTEHOST:/ /var/lib/vz/private/ID/
4) Stop all the services on remote server(i.e. mysql, apache, etc)
5) Do second rsync:
rsync -av --delete --numeric-ids --exclude=/boot/* --exclude=/lib/modules/* --exclude=/tmp/* \
 --exclude=/etc/blkid --exclude=/etc/mtab --exclude=/etc/lvm --exclude=/etc/fstab \
 --exclude=/etc/udev --exclude=/proc/* --exclude=/sys/* --exclude=/dev/* \
root@REMOTEHOST:/ /var/lib/vz/private/ID/
6) Start your container

And you're done!
* If you're using systemd this will probably fail.

1 комментарий:

  1. This examine investigated the impact of downside gambler gender on the relationship between the gambler having dependent kids living at house and the gambler perpetrating or being a vic... For more info on AAC’s commitment to 다파벳 moral advertising and remedy practices, or to study more about how to to|tips on how to} choose a remedy provider, visit our About AAC page. Our helpline is obtainable at no cost charge|without charge} to you and with no obligation to enter into remedy. Neither PsychGuides.com nor AAC receives any fee or different payment that's dependent upon which remedy provider a customer could finally choose. To talk about the signs of a gambling dependancy and your individual state of affairs.

    ОтветитьУдалить