Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 9 openvz VEs running on 3 physical servers. I'd like to add another VE to each physical server. Soooo, each physical server would then be running 4 VEs.

I used vzsplit -n 4 to generate new params to fit the VEs to the resources of the physical server. My problem is that I have to go in and manually update each VEs conf file.

Is there a better way to get the new params into each of the config files without manually editing each one? Even better, is there possibly a way to have all the conf files include parameters from a single file?

share|improve this question
add comment

3 Answers 3

up vote 1 down vote accepted

I solved my own problem. My solution was to execute the following bash script on all my openvz nodes in my cluster:

for VEID in vzlist | awk '{ print $1 }' | grep -v VEID; do vzctl set $VEID --applyconfig shared --save; done

The script gets the VEIDs from vzlist, and for each one does --applyconfig

I used puppet to distribute my custom ve-shared.conf-sample that contains everything I want to be the same in the VEs. I setup a puppet Exec that will automatically execute the bash script anytime I make a change to ve-shared.conf-sample

In this way I can update all my VEs running on my openvz cluster by editing a single file.

share|improve this answer
add comment

It's been a while since I used OpenVZ but you can probably accomplish what you want with vzctl --save and do all changes quickly.

FWIW we moved out of OpenVZ to VMware (ESX, not Server); while OpenVZ is much lighter, VMware was easier to manage day to day, and gave us flexibility to use different kernels and OSes. OpenVZ felt like it would be perfect if I wanted to run 100 simple web hosting "VPS" accounts on a single box, and was pretty awkward for most other uses.

share|improve this answer
add comment

vzsplit is just a recommendation, you dont really need to adjust all the parameters of all vms every time you add a new VM

Most of the barriers will never be hit, not even close. From my experience, most of the time privvmpages and oomguarpages are the only parameters that really matter.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.