Difference between revisions of "How to build Proxmox tmpfs image"
From openQRM
(added code to tty config) |
(add code to tty config) |
||
Line 34: | Line 34: | ||
## implement noclear for getty/inittab; | ## implement noclear for getty/inittab; | ||
### mkdir -p /etc/systemd/system/getty@tty1.service.d/ | ### mkdir -p /etc/systemd/system/getty@tty1.service.d/ | ||
− | ### edit file; /etc/systemd/system/getty@tty1.service.d/noclear.conf add contents;<blockquote> | + | ### edit file; /etc/systemd/system/getty@tty1.service.d/noclear.conf add contents;<blockquote> |
+ | <code> | ||
+ | [Service] | ||
+ | TTYVTDisallocate=no | ||
+ | </code> | ||
+ | </blockquote> | ||
##'''Remember: /etc/hosts needs a valid hostname with your ip address''' | ##'''Remember: /etc/hosts needs a valid hostname with your ip address''' | ||
### This is managed with the ATU plugin | ### This is managed with the ATU plugin |
Revision as of 09:42, 28 August 2021
Once you have a successfully installed and running openQRM Server you can follow the steps below for a Proxmox VE Solution.
Or we have a pre-built Proxmox template available for download.
Requirements:
- openQRM Community or Enterprise (can be run in a KVM/VM, suggested option)
- optional: openQRM ATU Plugin for advanced server and cluster provisioning
- CPU 64bit Intel EMT64 or AMD64
- PCI(e) passthrough requires VT-d/AMD-d CPU flag support
Suggest minimum Ram for:
- openQRM Server 4GB
- Virtual or Hardware Node (booted via tmpfs) 8GB. 4GB for tmpfs and 4GB for OS and Services.These instructions will help you to build a Proxmox VE Solution as a tmpfs deployment. The clustering requires special initialisation which is managed by the ATU Plugin to orchestrate these steps for synchronized cluster initialisation on start and backup configuration on shutdown.
- Download PVE Kernel - http://download.proxmox.com/debian/dists/bullseye/pve-no-subscription/binary-amd64/pve-kernel-5.11.22-3-pve_5.11.22-6_amd64.deb
- Install Kernel
- Add Kernel to openQRM
- (Replace KERNEL_NAME, KERNEL_VER, OPENQRM_UI_USER, OPENQRM_UI_PASS, SERVER_NAME with the appropriate variables) openqrm kernel add -n KERNEL_NAME -v KERNEL_VER -u OPENQRM_UI_USER -p OPENQRM_UI_PASS -l / -i initramfs
- openqrm kernel add -n pve-5.11.22-6 -v 5.11.22-3-pve -u OPENQRM_USER -p OPENQRM_PASS -l / -i initramfs
- If you are using a self signed cert you may need to load the https call back manually; https://SERVER_NAME/openqrm/base/server/kernel/kernel-action.php?kernel_command=new_kernel&kernel_name=KERNEL_NAME&kernel_version=KERNEL_VER
- Create Image - To create an image for Proxmox which can be used as a tmpfs image, follow these steps;
- apt-get install debootstrap
- Create directory mkdir -p /exports/proxmox_image/dev/pts
- debootstrap --arch amd64 buster /exports/proxmox_image/ https://deb.debian.org/debian/
- mount --bind /dev/pts /exports/proxmox_image/dev/pts
- mount --bind /dev/ /exports/proxmox_image/dev/
- mount --bind /proc /exports/proxmox_image/proc
- mount --make-rprivate /exports/proxmox_image/
- mount --bind /var/run/dbus /exports/proxmox_image/var/run/dbus
- chroot /exports/proxmox_image
- apt-get install wget net-tools screen locales collectd
- dpkg-reconfigure locales
- Follow steps (Start at "Install Proxmox VE") @ https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Buster
- We do not need to install grub
- set root password; passwd
- implement noclear for getty/inittab;
- mkdir -p /etc/systemd/system/getty@tty1.service.d/
- edit file; /etc/systemd/system/getty@tty1.service.d/noclear.conf add contents;
[Service]
TTYVTDisallocate=no
- Remember: /etc/hosts needs a valid hostname with your ip address
- This is managed with the ATU plugin
- exit chroot, type exit
- umount binds;
- umount /exports/proxmox_image/dev/pts
- umount /exports/proxmox_image/dev
- umount /exports/proxmox_image/proc
- umount /exports/proxmox_image/var/run/dbus
- For reference only; since Proxmox/Debian uses systemd management of services needs to be done externally of the chroot. To find enabled services;
- systemctl list-unit-files --root /exports/proxmox_image/ | grep enabled
- These services are managed by the ATU plugin. Since the ATU plugins manages cluster initialisation these services need to be started in an orderly fashion by the plugin. So then remove services from startup, systemd is not friendly, so we need to point systemctl to the root directory as follows;
- /bin/systemctl disable pve-cluster.service corosync.service pve-guests.service --root /exports/proxmox_image/
- /bin/systemctl disable lvm2-lvmpolld.socket lvm2-monitor.service --root /exports/proxmox_image/
- /bin/systemctl disable lxc.service lxc-net.service lxcfs.service lxc-monitord.service --root /exports/proxmox_image/
- /bin/systemctl disable portmap.service rpcbind.service nfs-client.target --root /exports/proxmox_image/
- /bin/systemctl disable iscsid.service iscsi.service open-iscsi.service --root /exports/proxmox_image/
- /bin/systemctl disable pve-firewall.service pvefw-logger.service pvesr.timer pve-daily-update.timer --root /exports/proxmox_image/
- /bin/systemctl disable pve-ha-crm.service pve-ha-lrm.service pve-lxc-syscalld.service --root /exports/proxmox_image/
- /bin/systemctl disable pvebanner.service pvedaemon.service pvenetcommit.service --root /exports/proxmox_image/
- /bin/systemctl disable pveproxy.service pvestatd.service --root /exports/proxmox_image/
- /bin/systemctl disable qmeventd.service spiceproxy.service ssh.service --root /exports/proxmox_image/
- /bin/systemctl disable rsyslog.service syslog.service --root /exports/proxmox_image/
- /bin/systemctl disable smartd.service dm-event.socket rbdmap.service --root /exports/proxmox_image/
- /bin/systemctl disable ceph.target ceph-fuse.target frr.service --root /exports/proxmox_image/
- /bin/systemctl disable zfs.target zfs-mount.service zfs-share.service --root /exports/proxmox_image/
- /bin/systemctl disable zfs-import.target zfs-import-cache.service zfs-volumes.target zfs-volume-wait.service zfs-share.service --root /exports/proxmox_image/
- If you have ceph installed disable;
- /bin/systemctl disable ceph-crash.service ceph-mds.target ceph-mgr.target ceph-mon.target ceph-osd.target remote-fs.target --root /exports/proxmox_image/
- If using the ATU Plugin then disable services: pvedaemon, pve-proxy, pve-manager, pve-cluster, cman, corosync, ceph, pvestatd, qemu-server, rrdcached, spiceproxy,
- Remember: /etc/hosts needs a valid hostname with your ip address
- Activate NFS Storage (if not already done so)
- Under Plugins -> Storage -> NFS-Storage
- Add NFS Storage;
- name "openqrm-nfs"
- Deployment Type: "nfs-deployment"
- Add NFS Volume (this triggers tmpfs storage)
- Under Plugins -> Storage -> NFS-Storage -> Volume Admin -> Edit -> proxmox_image "ADD IMAGE"
- restart server/vm in case of duplicate services started from chroot image initialisation
- Now create a TmpFs-Storage: Plugins -> Storage -> Tmpfs-storage -> Volume Admin -> New Storage
- Name: openqrm-tmpfs
- Deployment Type: tmpfs-storage
- Now Create an Image: Components -> Image -> Add new Image -> Tmpfs-root deployment -> click edit on the "openqrm-tmpfs" -> Click "ADD NEW VOLUME"
- Name: pve6
- Size: 4 GB
- Description: proxmox ve 6
- Now you will need to link a resource to a server. A resource is a blank system/server/chassis and a Server is a configuration applied to a resource/blank system. So you can either manually add a server or if a system has booted via dhcp/pxe then that system will be selectable and named "idle" for this next step.
- Click "ADD A NEW SERVER"
- Select the resource or manually setup a server
- then select n image for server, select the pve5 = tmpfs-deployment as previously setup (leave the tick on edit image details after selection.
- then select "Install from NAS/NFS" select the "proxmox_image" as above then click submit
- then select the kernel pve-5.11.22-6 then click submit
- Done
- Tar Image
- mkdir -p /usr/share/openqrm/web/boot-service/tmpfs/
- cd /exports/proxmox_image
- tar --exclude=usr/src --exclude=var/lib/apt/lists --exclude=usr/lib/jvm --exclude=var/lib/apt/lists --exclude=usr/share/man --exclude=usr/share/doc --exclude=usr/share/icons --numeric-owner -czf /usr/share/openqrm/web/boot-service/tmpfs/proxmox_image.tgz .
- Create NFS Image link to TmpFS image
- Then boot a KVM or Physical server via pxe/network boot
- The server will become an idle resource, once in this state a "Server" can be provisioned.
- Goto "Servers" and "ADD A NEW SERVER", you will need to;
- Name the Server
- Select the Server from a list, you will note that there will be an idle resource in the list, select that.
- Then you will need to select the image and kernel as created above.
- You can then start the server, once started the idle resource will reboot and boot the image as created above
- Once booted you may need to restart sshd and pve-cluster
- systemctl restart ssh pve-cluster
The ATU plugin manages the cluster and ceph configation states and boot orders.
Notes/Customisations:
- set root password (otherwise not able to login)
- Postfix may error a warning on boot, edit /etc/mailname
- Create directories /exports/custom/{fstab|modules|network}
Optional:
The ATU Plugin is optimised for Proxmox Cluster Deployments and TMPFS Server Configuration Sync Initialise ATU plugin