05.08.2013 Views

[PDF] Parallels Server 5 Bare Metal

[PDF] Parallels Server 5 Bare Metal

[PDF] Parallels Server 5 Bare Metal

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Customizing Container Reinstallation<br />

Managing Virtual Machines and Containers<br />

The default reinstallation, as performed by the pctl reinstall command, creates a new private<br />

area for the broken Container as if it were created by the pctl create command and copies the<br />

private area of the broken Container to the /old directory in the new private area so that no file is<br />

lost. There is also a possibility of deleting the old private area altogether without copying or<br />

mounting it inside the new private area, which is done by means of the --skipbackup option.<br />

This way of reinstalling corrupted Containers might in certain cases not correspond exactly to your<br />

particular needs. It happens when you are accustomed to creating new Containers in some other<br />

way than just using the pctl create command. For example, you may install additional software<br />

licenses into new Containers, or anything else. In this case you would naturally like to perform<br />

reinstallation in such a way so that the broken Container is reverted to its original state as<br />

determined by you, and not by the default behavior of the pctl create command.<br />

To customize reinstallation, you should write your own scripts determining what should be done<br />

with the Container when it is being reinstalled, and what should be configured inside the Container<br />

after it has been reinstalled. These scripts should be named vps.reinstall and<br />

vps.configure, respectively, and should be located in the /etc/vz/conf directory on the<br />

server. To facilitate your task of creating customized scripts, the Containers software is shipped<br />

with sample scripts that you may use as the basis of your own scripts.<br />

When the pctl reinstall command is called, it searches for the vps.reinstall<br />

and vps.configure scripts and launches them consecutively. When the vps.reinstall<br />

script is launched, the following parameters are passed to it:<br />

--veid The ID of the Container.<br />

--ve_private_tmp The path to the Container temporary private area. This path designates where<br />

a new private area is temporarily created for the Container. If the script runs<br />

successfully, this private area is mounted to the path of the original private area<br />

after the script has finished.<br />

--ve_private The path to the Container original private area.<br />

You may use these parameters within your vps.reinstall script.<br />

If the vps.reinstall script finishes successfully, the Container is started, and the<br />

vps.configure script is called. At this moment the old private area is mounted to the /old<br />

directory inside the new one irrespective of the --skipbackup option. This is done in order to let<br />

you use the necessary files from the old private area in your script, which is to be run inside the<br />

running Container. For example, you might want to copy some files from there to regular Container<br />

directories.<br />

After the vps.configure script finishes, the old private area is either dismounted and deleted or<br />

remains mounted depending on whether the --skipbackup option was provided.<br />

If you do not want to run these reinstallation scripts and want to stick to the default pctl<br />

reinstall behavior, you may do either of the following:<br />

79

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!