Proxmox boot from ISCSI target boot file

dacimovic

New Member
Jun 20, 2024
1
0
1
Hello,
in our inviroment we have VMware ESXi installation through ISCSI boot target image (file) . All inviroment basic on tgtd and dnsmasq service which define boot target file and after installation all changes write to that boot image file. Everything is working ok, but we need to know if that posible to do with Proxmox installation ?
One more, OS is booting from iscsi target file and all changes is writing online.
Thank you.
This is bash script for creating iscsi boot image file ( esxi67u3b20497097-installation-8GB-testing.img ) for VMware ESXi (just like example to better understanding)
Code:
#! /bin/bash


mkdir isoMNT
mkdir imgMNT
iso="VMware-VMvisor-Installer-6.7.0.update03-20497097.x86_64-DellEMC_Customized-A19.iso"
img=esxi67u3b20497097-installation-8GB-testing.img
#  dd if=/dev/zero of=$img bs=1M count=32000
dd if=/dev/zero of=$img bs=1M count=8000
losetup -fP $img
loopDEV=`losetup -a| grep $img|awk -F":" '{print $1}'`
echo $loopDEV
dd if=/usr/share/syslinux/mbr.bin of=$loopDEV
parted -a optimal -s $loopDEV mklabel msdos mkpart primary fat32 2048s 8380M set 1 boot on


mkfs.vfat -F 32 ${loopDEV}p1
syslinux -ma ${loopDEV}p1
mount $iso isoMNT
mount -o loop ${loopDEV}p1 imgMNT
yes | cp -a isoMNT/* imgMNT/  # copy everything from VMWare ISO to the new disk image
sed -i 's|kernelopt=runweasel cdromBoot|kernelopt=ks=http://xx.xx.xx.xx/esxi67/ks.cfg vlanid=22 ip=dhcp|' imgMNT/boot.cfg
sed -i 's|kernelopt=runweasel cdromBoot|kernelopt=ks=http://xx.xx.xx.xx/esxi67/ks.cfg vlanid=22 ip=dhcp|' imgMNT/efi/boot/boot.cfg
mv imgMNT/isolinux.cfg imgMNT/syslinux.cfg
if [[ `echo $iso| grep '6.7' -c` -eq 1 ]] ; then
   # replace native VMware 6.7 menu.c32 with syslinux-4.06
   # standard for Centos 7 is syslinux-4.05
   wget https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/Testing/4.06/syslinux-4.06-pre14.tar.gz --no-check-certificate
   tar -xzf syslinux-4.06-pre14.tar.gz
   yes| cp syslinux-4.06-pre14/com32/menu/menu.c32 imgMNT/menu.c32 -f
   rm -fr syslinux-4.06-pre14
   rm -f syslinux-4.06-pre14.tar.gz
fi
umount isoMNT imgMNT
rm -fr isoMNT imgMNT
losetup -d $loopDEV
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!