Proxmox VE 4 installation of the root partition on an unsupported installer soft raid1

  • Tutorial

Starting with version 3.6, the Proxmox installer has the option to install on various ZFS Raid options, but the configuration with the location of the root and the storage area of ​​virtual machine disks on the software RAID array has not appeared, used by many.
There are many similar articles on the hub and on the network, but they are relevant for version 3.6, and in version 4.0 several interesting nuances have appeared. In addition, in this instruction I will approach the solution of this problem in a completely different way.


Nuances


1. The installer of Proxmox 4th version puts us an efi bootloader and I don’t see a way how to reserve it using a software raid - if someone knows, share it.
2.Proxmox 4.0 is built on Debian 8, and it has a known bug - arrays are not collected when the system starts, if one of the disks has flown in it. The “bootdegraded = 1” option is not collected at all and does not work.
3. Having examined items 1 and 2, I wondered why we should edit something for the Proxmox installers, when we can safely install Debian 8 as we need, and install Proxmox on top . This alignment will be considered in the instructions.

We put Debian 8


I think you can handle installing Debian 8 minimal from a neinst disk.
We do all the settings as you need, consider only the partitioning of disks:
- I have disks with a partition table in GPT
- select a 1 MB partition and mark it as bios boot
- allocate the remaining space in the partition as an array
- collect the md0 array
- start LVM on top of the array
- create LV under the root and swap

Check the bug - pull out any of the disks, members of the array, and boot. Rather, we do not boot, because the bootloader cannot find the LVM with the root partition, because the array on which this same LVM is not assembled is.

UPD in Debian 8.5 has already been repaired and no need to apply a patch (or rather, it may have been repaired before, but it was checked on 8.5)

Repair the array assembly at boot time


I put grub on both sections during installation, if you did not:
# dpkg-reconfigure grub-pc


Apply a patch:
cd /etc/initramfs-tools/scripts/local-top
cp /usr/share/initramfs-tools/scripts/local-top/mdadm .
patch --verbose --ignore-whitespace <<'EndOfPatch'
--- mdadm
+++ mdadm
@@ -76,7 +76,15 @@
   if $MDADM --assemble --scan --run --auto=yes${extra_args:+ $extra_args}; then
     verbose && log_success_msg "assembled all arrays."
   else
-    log_failure_msg "failed to assemble all arrays."
+    log_warning_msg "failed to assemble all arrays...attempting individual starts"
+    for dev in $(cat /proc/mdstat | grep md | cut -d ' ' -f 1); do
+      log_begin_msg "attempting mdadm --run $dev"
+      if $MDADM --run $dev; then
+        verbose && log_success_msg "started $dev"
+      else
+        log_failure_msg "failed to start $dev"
+      fi
+    done
   fi
   verbose && log_end_msg
EndOfPatch

Update config:
update-initramfs -u


Attention: if you will check how the patch works and boot with the disk pulled out, then forget to return it back to the array:
# mdadm --add /dev/md0 /dev/sda2


We put Proxmox


Bring / etc / hosts to the form:
127.0.0.1       localhost.localdomain localhost
123.456.789.1   myproxmox.mydomain.ru  myproxmox pvelocalhost


Add to /etc/apt/sources.list
deb http://download.proxmox.com/debian jessie pve-no-subscription


Add a digital signature:
# wget -O- "http://download.proxmox.com/debian/key.asc" | apt-key add -


Updated:
# apt-get update && apt-get dist-upgrade


Install Proxmox:
# apt-get install proxmox-ve ntp ssh postfix ksm-control-daemon open-iscsi


When installed in /etc/apt/sources.list.d/pve-enterprise.list, the commercial repository will be registered, if there is no subscription, we will comment on it.

Reboot and use.

Also popular now: