Keeping the VEs upon hardware machine reinstall?
Hi, there. If I reinstall the hardware node, all config files under /etc/vz get lost. However, if I set a different file system for the private areas, the VEs are still there. How can I tell OpenVZ that "what is under /vz/private/200 must be reused as VE 200" and thus skip the OS template expansion? Just making a tar.gz of it and telling that's the new template is not acceptable to me (I might have to re-install hundreds of physical nodes). Thanks in advance.
Re: Keeping the VEs upon hardware machine reinstall?
Hello, As far as I understand you have got "/vz" on a separate partition. So when you reinstall your HN "/" will change but "/vz" will be the same. And you want to use "old" /vz partition on the "new" HN. I think the following steps should help us: 1. Save /etc/vz/conf directory. 2. Install new OS on your HN. 3. Install OpenVZ on the pure HN. (For example like it's described in OpenVZ guide or there http://wiki.openvz.org/Quick_installation) 4. Restore /etc/vz/conf directory. I suppose it should work. Thank You!
Maratus, thanks for your answer. Quote: As far as I understand you have got "/vz" on a separate partition. So when you reinstall your HN "/" will change but "/vz" will be the same. And you want to use "old" /vz partition on the "new" HN. You understood perfectly. Quote: I think the following steps should help us: 1. Save /etc/vz/conf directory.[...] The problem is that this doesn't scale in my scenario. Remember that I may have to reinstall hundreds of HNs in one go. I don't want any kind of human intervention in installing or configuring neither the HNs nor the VEs. Long story short, all I need is something like vzctl create 10000 --noostemplate --private /vz/private/10000 Then, just running the appropraite vzctl set commands would recover my VE in seconds, with no data loss. A nice wish for bugzilla? Cheers.
Hi, 1. A particular VPS can be considered as a set of three parts: - Disk data. - Resource limits. - Some kind of confuguration. a) /vz/private/VE_ID is responsible for the first item. b) VE.conf file is responsible for the last two items. So, for example what value of PRIVVMPAGES do you expect from the following command? Quote: vzctl create 10000 --noostemplate --private /vz/private/10000 2. Quote: 1. Save /etc/vz/conf directory.[...] You can create two simple scripts: - One of them save that directory or for example move it to the "/vz" partition - The other restore /etc/vz/conf directory "/etc/vz/conf" contains only conf files. Run the first script when you want to reinstall your HN. It saves ALL your VPSes. And then run the second one after you reinstall HN. Then just type: vzctl start VE_ID It should work!
or: move /etc/vz/conf to your /vz/conf(ig) and create a symlink from /etc/vz/conf -> /vz/conf After any reinstall without deleting the VZ Partion, (re-)link /etc/vz/conf to /vz/conf(ig).
"matatrus" b) VE.conf file is responsible for the last two items. So, for example what value of PRIVVMPAGES do you expect from the following command? Quote: vzctl create 10000 --noostemplate --private /vz/private/10000 I don't care. I'd expect the same PRIVVMEMPAGES as if I run vzctl create 1000 --private /vz/private/1000 --ostemplate cern-4-x86_64-default To make this easier to understand, (sorry for spamming), I'm integrating OpenVZ VE management within Quattor. My code performs something like this: if ! vzlist 1000 then vzctl create 10000 --private /vz/private --ostemplate cern-4-x86_64-default fi vzctl set 1000 --privvmempages <privvmempages> --diskspace <diskspace> --hostname <hostname>... vzctl start 1000 So, my "--noostemplate" requirement would be just another "if" inside the first if statement. Simple to me, and transparent for my users, if it was at all supported. "curx" move /etc/vz/conf to your /vz/conf(ig) and create a symlink from /etc/vz/conf -> /vz/conf Yes, this workaround will work with our framework. Thanks! Although it would be simpler for users to avoid this... Cheers.