AII version 2 and complex block device schemas
Version 2 of the Automated Installation Infrastructure (AII) component of Quattor, enables to configure and install hosts with complex block device schemas. Complex block device schemas may consist of combinations of for example multiple disks, (software) RAID devices and Logical Volumes. This section describes a concrete example of such a setup.
Desired Setup
The concrete example we consider is a generic server with 2 identical 500 GB SCSI disks. These disks will be operated in a software RAID-1 setup, where every partition will be mirrored on the both disks.
The server will have file systems /boot, /, /tmp, a swap partition, and a logical volume group that will contain space for future file systems.
This setup is organized as follows. On every disk, there will be 4 partitions: sda1-sda4 and sdb1-sdb4. The partitions are combined in software RAID1 devices md0-md3. The /boot, / and swap file systems are placed directly on the RAID1 devices md0-md2. Device md3 will host a logical volume group called 'dom0', in which a logical volume /tmp will be created.
sda1+sdb1 md0 /boot 256 MB sda2+sdb2 md1 / 8 GB sda3+sdb3 md2 swap 4 GB sda4+sdb4 md3 LVG dom0 rest dom0 /tmp 4 GB
Pan Templates
The setup described above can be configured in Pan in two steps. One step describes the block devices (disk partitions, RAID1, LVM), the other step specifies how the file systems relate to the block devices.
The following Pan code configures the desired block device setup:
variable DEV_MD ?= "md"; variable DEV_D1 ?= "sda"; variable DEV_D2 ?= "sdb";
include quattor/blockdevices;
"/system/blockdevices" = nlist ( "physical_devs", nlist ( DEV_D1, nlist ("label", "msdos"), DEV_D2, nlist ("label", "msdos"), ), "partitions", nlist ( DEV_D1+"1", nlist ( "holding_dev", DEV_D1, "size", 256, ), DEV_D1+"2", nlist ( "holding_dev", DEV_D1, "size", 8192, ), DEV_D1+"3", nlist ( "holding_dev", DEV_D1, "size", 4096, ), DEV_D1+"4", nlist ( "holding_dev", DEV_D1, ),
DEV_D2+"1", nlist ( "holding_dev", DEV_D2, "size", 256, ), DEV_D2+"2", nlist ( "holding_dev", DEV_D2, "size", 8192, ), DEV_D2+"3", nlist ( "holding_dev", DEV_D2, "size", 4096, ), DEV_D2+"4", nlist ( "holding_dev", DEV_D2, ), ), "md", nlist( DEV_MD+"0", nlist( "device_list", list("partitions/"+DEV_D1+"1", "partitions/"+DEV_D2+"1"), "raid_level", "RAID1", ), DEV_MD+"1", nlist( "device_list", list("partitions/"+DEV_D1+"2", "partitions/"+DEV_D2+"2"), "raid_level", "RAID1", ), DEV_MD+"2", nlist( "device_list", list("partitions/"+DEV_D1+"3", "partitions/"+DEV_D2+"3"), "raid_level", "RAID1", ), DEV_MD+"3", nlist( "device_list", list("partitions/"+DEV_D1+"4", "partitions/"+DEV_D2+"4"), "raid_level", "RAID1", ), ), "volume_groups", nlist( "dom0", nlist( "device_list", list("md/"+DEV_MD+"3"), ), ), "logical_volumes", nlist( "tmp", nlist( "size", 4096, "volume_group", "dom0" ), "test", nlist( "size", 10240, "volume_group", "dom0" ), ), );