OpenVZ Forum


Home » General » Support » Keeping the VEs upon hardware machine reinstall?
Keeping the VEs upon hardware machine reinstall? [message #29782] Thu, 24 April 2008 11:38 Go to next message
ArsDangor is currently offline  ArsDangor
Messages: 6
Registered: March 2008
Junior Member
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.


If all the world is a stage, I want better ligthting.
Re: Keeping the VEs upon hardware machine reinstall? [message #29806 is a reply to message #29782] Fri, 25 April 2008 07:17 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
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!
Re: Keeping the VEs upon hardware machine reinstall? [message #29839 is a reply to message #29806] Fri, 25 April 2008 23:07 Go to previous messageGo to next message
ArsDangor is currently offline  ArsDangor
Messages: 6
Registered: March 2008
Junior Member
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.


If all the world is a stage, I want better ligthting.
Re: Keeping the VEs upon hardware machine reinstall? [message #29853 is a reply to message #29839] Sun, 27 April 2008 11:03 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
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!



Re: Keeping the VEs upon hardware machine reinstall? [message #29857 is a reply to message #29853] Sun, 27 April 2008 12:08 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

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).



Re: Keeping the VEs upon hardware machine reinstall? [message #29858 is a reply to message #29857] Sun, 27 April 2008 14:09 Go to previous message
ArsDangor is currently offline  ArsDangor
Messages: 6
Registered: March 2008
Junior Member
"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.


If all the world is a stage, I want better ligthting.
Previous Topic: Debian: no network after upgrade
Next Topic: Install errors
Goto Forum:
  


Current Time: Sun Jul 14 12:51:12 GMT 2024

Total time taken to generate the page: 0.02348 seconds