Skip to content

Instantly share code, notes, and snippets.

@nraynaud
Last active September 6, 2020 18:49
Show Gist options
  • Save nraynaud/0805e93eb624b52e1416d7be1b764b45 to your computer and use it in GitHub Desktop.
Save nraynaud/0805e93eb624b52e1416d7be1b764b45 to your computer and use it in GitHub Desktop.
Unattended installation of Xenserver with iso file

Unattended installation of Xenserver with iso file

  • create answers.xml
  • unpack iso file
    mount sudo mount XenServer-7.1.0-s1-install-cd.iso /mnt
    mkdir newContent
    (cd /mnt; sudo tar cf - .) |  (cd newContent; tar xfp -)
  • alter install.img to add answers.xml
    chmod +w newContent/install.img
    echo ./answers.xml | cpio -H newc -o | bzip2 | cat /mnt/install.img - > newContent/install.img
  • chmod +w then edit boot/isolinux/isolinux.cfg

add answerfile=file:///answers.xml install to the default target, the file address is relative to the initram FS, hence the prior addition of the file to intall.img

  • repack iso
    sudo genisoimage -o newIso.iso -b boot/isolinux/isolinux.bin -c boot/isolinux/isolinux.cat -no-emul-boot -boot-load-size 4 -boot-info-table -J -R -V "XenServer-7.1.0 Base Pack" newContent
    
<?xml version="1.0"?>
<installation srtype="lvm">
<primary-disk>sda</primary-disk>
<keymap>fr</keymap>
<root-password>lol</root-password>
<source type="local"/>
<admin-interface name="eth0" proto="dhcp" />
<timezone>Europe/Paris</timezone>
</installation>
DEFAULT install
PROMPT 1
TIMEOUT 50
DISPLAY pg_main
F1 pg_main
F2 pg_help
LABEL install
KERNEL mboot.c32
APPEND /boot/xen.gz dom0_max_vcpus=1-2 dom0_mem=1024M,max:1024M com1=115200,8n1 console=com1,vga --- /boot/vmlinuz xencons=hvc console=hvc0 console=tty0 answerfile=file:///answers.xml install --- /install.img
LABEL no-serial
KERNEL mboot.c32
APPEND /boot/xen.gz dom0_max_vcpus=1-2 dom0_mem=1024M,max:1024M console=vga --- /boot/vmlinuz console=tty0 --- /install.img
LABEL safe
KERNEL mboot.c32
APPEND /boot/xen.gz dom0_max_vcpus=1-2 dom0_mem=1024M,max:1024M nosmp noreboot noirqbalance no-mce no-bootscrub no-numa no-hap no-mmcfg iommu=off max_cstate=0 nmi=ignore allow_unsafe com1=115200,8n1 console=com1,vga vga=keep --- /boot/vmlinuz xencons=hvc console=hvc0 console=tty0 --- /install.img
LABEL multipath
KERNEL mboot.c32
APPEND /boot/xen.gz dom0_max_vcpus=1-2 dom0_mem=1024M,max:1024M com1=115200,8n1 console=com1,vga --- /boot/vmlinuz xencons=hvc console=hvc0 console=tty0 device_mapper_multipath=enabled --- /install.img
LABEL shell
KERNEL mboot.c32
APPEND /boot/xen.gz dom0_max_vcpus=1-2 dom0_mem=1024M,max:1024M com1=115200,8n1 console=com1,vga --- /boot/vmlinuz xencons=hvc console=hvc0 console=tty0 bash-shell --- /install.img
LABEL memtest
KERNEL memtest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment