Installing a VServer guest with debootstrap and softupdate: Difference between revisions

From FAIWiki
Jump to navigation Jump to search
(Initial version of the page.)
 
(Added the info about /tmp being too small)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Many people don't use the -m fai VServer build method (maybe because it's broken?) but build their VServer guests without FAI, using debootstrap or any other standard method. A guest installed like that will now nothing about FAI, so in order to turn it into a FAI install client, some manual extra steps are necessary at least once. There are also some pitfalls.
Many people don't use the -m fai VServer build method (maybe because it's broken?) but build their VServer guests without FAI, using debootstrap or any other standard method. A guest installed like that will now nothing about FAI, so in order to turn it into a FAI install client, some manual extra steps are necessary at least once. There are also some pitfalls.


= Your guest cannot NFS mount by default =
= The guest cannot NFS mount by default =


For security reasons, the defaults do not allow a VServer guest to perform NFS mounts. In case your FAI config space lives on a separate physical server and therefore needs to be mounted through NFS, this will lead to a <tt>permission denied</tt> error.
For security reasons, the defaults do not allow a VServer guest to perform NFS mounts. In case your FAI config space lives on a separate physical server and therefore needs to be mounted through NFS, this will lead to a <tt>permission denied</tt> error.
Line 29: Line 29:
= The FAI client needs to know about your config space =
= The FAI client needs to know about your config space =


In <tt>/etc/fai/fai.conf</tt> look for the line:
In the file <tt>/etc/fai/fai.conf</tt> look for the line:


<pre>
#FAI_CONFIG_SRC=nfs://yourserver/$FAI_CONFIGDIR
#FAI_CONFIG_SRC=nfs://yourserver/$FAI_CONFIGDIR
</pre>
Uncomment this line and replace <tt>yourserver</tt> with the hostname of the sevrer that is exporting your config space via NFS.


Uncomment and replace yourserver with the hostname of the sevrer that is exporting your config space via NFS.
= The guest does not have enough space in /tmp by default =


= We don't know our FAI classes yet =
By default, a VServer guest mounts /tmp to a ramdisk with 16 MB of RAM. This will cause the updatebase step of FAI to stall because it tried to write more than 16 MB to a file in /tmp. There are a number of ways to solve that problem, such as
 
* Unmount /tmp, so it will use the filesystem, not the ramdisk.
* Increase the available space in /tmp.
* Set the variable TMPDIR to something else, for example using a VSCHILD.var file in your config space.
 
<pre>
TMPDIR=/var/tmp
</pre>
 
 
= The guest does not yet have any FAI classes =


Make sure to run
Make sure to run


<code>
<pre>
fai softupdate -N
fai softupdate -N
</code>
</pre>


as the -N option will make sure that the class detection for your VServer guest is done from scratch. Without the -N option, you will just see an error message saying that /var/log/fai/classes was not found.
as the <tt>-N</tt> option will make sure that the class detection for your VServer guest is done from scratch. Without the <tt>-N</tt> option, you will just see an error message saying that <tt>/var/log/fai/classes</tt> was not found.

Latest revision as of 13:39, 17 October 2007

Many people don't use the -m fai VServer build method (maybe because it's broken?) but build their VServer guests without FAI, using debootstrap or any other standard method. A guest installed like that will now nothing about FAI, so in order to turn it into a FAI install client, some manual extra steps are necessary at least once. There are also some pitfalls.

The guest cannot NFS mount by default

For security reasons, the defaults do not allow a VServer guest to perform NFS mounts. In case your FAI config space lives on a separate physical server and therefore needs to be mounted through NFS, this will lead to a permission denied error.

To fix this problem, on the VServer host, create a file called

/etc/vservers/<vserver>/bcapabilities

with the following content:

CAP_SYS_ADMIN

If your VServer guest was already running, make sure to re-start it for these settings to become effective. (Q: Would there be a parameter to set this at guest build time???)

You need a FAI client on your guest

Before you can do anything else, you will need to install the fai-client package:

aptitude install fai-client

The FAI client needs to know about your config space

In the file /etc/fai/fai.conf look for the line:

#FAI_CONFIG_SRC=nfs://yourserver/$FAI_CONFIGDIR

Uncomment this line and replace yourserver with the hostname of the sevrer that is exporting your config space via NFS.

The guest does not have enough space in /tmp by default

By default, a VServer guest mounts /tmp to a ramdisk with 16 MB of RAM. This will cause the updatebase step of FAI to stall because it tried to write more than 16 MB to a file in /tmp. There are a number of ways to solve that problem, such as

* Unmount /tmp, so it will use the filesystem, not the ramdisk.
* Increase the available space in /tmp.
* Set the variable TMPDIR to something else, for example using a VSCHILD.var file in your config space.
TMPDIR=/var/tmp


The guest does not yet have any FAI classes

Make sure to run

fai softupdate -N

as the -N option will make sure that the class detection for your VServer guest is done from scratch. Without the -N option, you will just see an error message saying that /var/log/fai/classes was not found.