|
Shared filesystem imagesShared filesystem images are images which are shared between multiple concurrent running instances. They are used to minimize the maintenance work involved in maintaining images - when multiple applications or application instances can use the same basic environment, it makes sense to maintain this environment only once. You can cause any filesystem image to become a shared FS image by clicking on the shared checkbox in the configuration page for that FS image in the GUI. You can then have a single VE run multiple nodes against the same FS image. Imagine a web server VE with 10+ nodes running the same VE and DOCROOT. When using a shared image, all of instances use the same basic binaries and libraries. Each node has copy of /var, /proc, /etc and /tmp, as well as additional user-defined directories mounted over NFS. Unlike the other directories, these directories are not shared, and their contents are persistent. They are referred to as 'private' directories. The location of the underlying directories is inside the image at /private/<VE_ID>/<VEM_ID>/var and /private/<VE_ID>/<VEM_ID>/tmp. See the details below for more explanation. Subdirectories of private directories can be shared; while /var is private /var/lib/rpm is shared. Note: /var/run is still in a RAM disk (but is populated from the original /var/run/); it is truly run-time data only and would have problems working over NFS. Shared Image customization A directory /custom is added to each image. This directory has two sub directories, /custom/node and /custom/ve. The former is private per node (like /var) and can be used to put files from directories that are otherwise shared, and link to them. The latter is shared per VE, but different amongst different VEs. The location of the underlying directories inside the image are | /custom/node | /private/<VE_ID>/<VEM_ID>/custom | | /custom/ve | /private/<VE_ID>/custom |
For example, if I want different VEs to schedule different taks, I would (for a VE with ID of 10): * move /etc/crontab to <image path>/private/10/custom/etc/crontab * modify the crontab file with the custom tasks * create a symbolic link from <image path>/private/10/custom/etc/crontab to <image path>/etc/crontab When a node is assigned to that VE (using the image) its /etc/crontab will be the modified one. Note: to get the ID of the VE you can search for it and look at the 'id=' parameter in the link's URL. Note: to make a file under /var shared by all move it to /custom and link to it; to make a file shared by only nodes of the same VE move it to /custom/ve (like the example above) and link to it. When a new node is added to a Multi-Server VE, a new /custom/node is created for it, located in /private/$VE_ID/$CS_VEM/custom. At this point, if the script /private/$VE_ID/init_vem exists and is executable, it runs it with the $VE_ID and $CS_VEM as parameters.
|