... | ... | @@ -213,19 +213,7 @@ the [storage servers documentation](howto/new-machine-cymru#storage-servers) for |
|
|
|
|
|
and the device `/dev/mapper/test-01` should exist.
|
|
|
|
|
|
5. then the disk needs to be partitioned correctly:
|
|
|
|
|
|
parted --script --align optimal /dev/mapper/test-01 $(cat iscsi-parted-script.txt )
|
|
|
|
|
|
Note that this is kind of a gross hack: we setup an MBR
|
|
|
(MSDOS-style!) partition over that LUN, and then each partition
|
|
|
gets adopted by the VM *individually*. The `create` script in
|
|
|
`ganeti-instance-debootstrap` then adds *another* MBR partition on
|
|
|
the first of those partitions to get GRUB to work. It's a total
|
|
|
mess. Details in [tpo/tpa/team#40775](https://gitlab.torproject.org/tpo/tpa/team/-/issues/40775), see also [upstream
|
|
|
support about GPT](https://github.com/ganeti/instance-debootstrap/issues/5).
|
|
|
|
|
|
6. adopt the disks in Ganeti:
|
|
|
5. adopt the disk in Ganeti:
|
|
|
|
|
|
gnt-instance add \
|
|
|
-n chi-node-01.torproject.org \
|
... | ... | @@ -234,9 +222,7 @@ the [storage servers documentation](howto/new-machine-cymru#storage-servers) for |
|
|
--net 0:ip=pool,network=gnt-chi-01 \
|
|
|
--no-ip-check \
|
|
|
--no-name-check \
|
|
|
--disk 0:adopt=/dev/disk/by-id/dm-name-telegram-bot-01-part2 \
|
|
|
--disk 1:adopt=/dev/disk/by-id/dm-name-telegram-bot-01-part3,name=swap \
|
|
|
--disk 2:adopt=/dev/disk/by-id/dm-name-telegram-bot-01-part4 \
|
|
|
--disk 0:adopt=/dev/disk/by-id/dm-name-test-01 \
|
|
|
--backend-parameters memory=8g,vcpus=2 \
|
|
|
test-01.torproject.org
|
|
|
|
... | ... | @@ -245,7 +231,7 @@ the [storage servers documentation](howto/new-machine-cymru#storage-servers) for |
|
|
|
|
|
NOTE: mixing DRBD and iSCSI volumes on a single instance is not supported.
|
|
|
|
|
|
7. at this point, the VM probably doesn't boot, because for some
|
|
|
6. at this point, the VM probably doesn't boot, because for some
|
|
|
reason the `gnt-instance-debootstrap` doesn't fire when disks are
|
|
|
adopted. so you need to reinstall the machine, which involves
|
|
|
stopping it first:
|
... | ... | @@ -253,11 +239,39 @@ the [storage servers documentation](howto/new-machine-cymru#storage-servers) for |
|
|
gnt-instance shutdown --timeout=0 test-01
|
|
|
gnt-instance reinstall test-01
|
|
|
|
|
|
HACK: the current installer fails on weird partionning errors, see
|
|
|
HACK one: the current installer fails on weird partionning errors, see
|
|
|
[upstream bug 13](https://github.com/ganeti/instance-debootstrap/issues/13).
|
|
|
We applied [patch 17](https://github.com/ganeti/instance-debootstrap/pull/17)
|
|
|
on `chi-node-01` and sent it upstream for review before committing to
|
|
|
maintaining this in Debian or elsewhere.
|
|
|
We applied [this patch](https://github.com/jcharaoui/instance-debootstrap/commit/6ee6c84d8eeb67fef061e05ccd4a5fde12206f06)
|
|
|
as a workaround to avoid failures when the installer attempts to partition
|
|
|
the virtual disk.
|
|
|
|
|
|
HACK two: by default, when using the 'msdos' partitioning style, the installer
|
|
|
creates a partition that spans the entire length of the virtual disk,
|
|
|
leaving no space to create extra partitions for swap and `/srv`. So we
|
|
|
applied [this other patch](https://github.com/jcharaoui/instance-debootstrap/commit/63aba3df727d2c2bd13ceadaa40f8074e9e933dd)
|
|
|
on `chi-node-01` to allow us to specify a partition size for the root
|
|
|
filesystem in `/etc/default/ganeti-instance-debootstrap` via the
|
|
|
`PARTITION_SIZE` variable.
|
|
|
|
|
|
7. log in to the instance via the console (see [next steps](#next-steps)) and
|
|
|
add the swap and `/srv` partitions then reboot:
|
|
|
|
|
|
echo ",8G,S," | sfdisk --no-reread -N2 /dev/sda
|
|
|
echo ",+,L," | sfdisk --no-reread -N3 /dev/sda
|
|
|
reboot
|
|
|
|
|
|
8. replace the default swap file with a swap partition:
|
|
|
|
|
|
swapoff /swapfile && rm /swapfile
|
|
|
mkswap /dev/sda2
|
|
|
sed -i "s#/swapfile#$(blkid /dev/sda2 | grep -Po '\bUUID=\S+')#" /etc/fstab
|
|
|
swapon -a
|
|
|
|
|
|
9. create a `/srv` filesystem:
|
|
|
|
|
|
mkfs.ext4 -j /dev/sda3
|
|
|
echo "$(blkid /dev/sda3 | grep -Po '\bUUID=\S+') /srv ext4 defaults 0 2" >> /etc/fstab
|
|
|
mount /srv
|
|
|
|
|
|
From here on, follow the [next steps](#next-steps) above.
|
|
|
|
... | ... | |