User Tools

Site Tools


proxmox:install_proxmox_ve_from_pxe

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

proxmox:install_proxmox_ve_from_pxe [2015/06/29 12:10] (current)
Line 1: Line 1:
 +===== Introduction =====
  
 +In order to have the installer find the .ISO image it needs to be embedded in the initrd.img that will be downloaded via PXE.
 +
 +An overview of the required steps:
 +
 +  - Extract/​copy initrd.img and linux26 from the .ISO image.
 +  - Extract initrd.img to a directory.
 +  - Copy the .ISO image as proxmox.iso to the initrd directory.
 +  - Create a new initrd.img from the directory.
 +  - Copy the new initrd.img to the PXE server.
 +
 +
 +===== Step by step =====
 +
 +  - Mount the proxmox iso in a temporal directory: <​code>#​ mount proxmox-ve_3.3-a06c9f73-2.iso proxmox-iso/</​code>​
 +  - Copy "​proxmox-iso/​boot/​initrd.img"​ and "​proxmox-iso/​boot/​linux26"​ to a temp directory '​initrd-temp':<​code>#​ mkdir initrd-temp
 +# cp proxmox-iso/​boot/​initrd.img ./​initrd-temp
 +# cp proxmox-iso/​boot/​linux26 ./​initrd-temp</​code>​
 +   - Move to '​initrd-temp'​ directory and rename "​initrd.img"​ to "​initrd.org.img",​ then unzip it: <​code>#​ cd initrd-temp
 +# mv initrd.img initrd.org.img
 +# gzip -d -S "​.img"​ ./​initrd.org.img</​code>​
 +   - Create a directory '​initrd.tmp'​ for the files in the initrd, extract initrd to this directory:<​code>#​ mkdir initrd.tmp
 +# cd initrd.tmp
 +# cpio -i -d < ../​initrd.org</​code>​
 +   - Umount the Proxmox ISO and copy it as proxmox.iso:<​code>#​ umount ../​../​proxmox-iso/​
 +# cp ../​../​proxmox-ve_3.3-a06c9f73-2.iso proxmox.iso</​code>​
 +   - Create a new initrd.img:<​code>#​ find . | cpio -H newc -o > ../​initrd</​code>​
 +   - Zip this new initrd:<​code>#​ cd ..
 +# gzip -9 -S "​.img"​ initrd</​code>​
 +
 +You should now have an much enlarged "​initrd.img"​ file containing all original files from the original "​initrd.org.img"​ as well as the .ISO. Copy it to your TFPT server (or HTTP server, for this you must to use gpxelinux.0 instead pxelinux.0) together with the "​linux26"​ file:
 +
 +<​code>​
 +# cp linux26 /​srv/​tftp/​commons/​proxmox/​proxmox-ve_3.3
 +# cp initrd.img /​srv/​tftp/​commons/​proxmox/​proxmox-ve_3.3
 +</​code>​
 +
 +
 +===== TFTP menu configuration =====
 +
 +Your TFTP configuration for the menu, may look like:
 +
 +<​code>​
 +label proxmox3.3
 +        menu label PROXMOX VE 3.3 Installer
 +        kernel commons/​proxmox/​proxmox-ve_3.3/​linux26
 +        append vga=791 video=vseafb:​ywrap,​mtrr ramdisk_size=819200
 +        initrd commons/​proxmox/​proxmox-ve_3.3/​initrd.img splash=verbose
 +</​code>​
 +
 +**NOTE:** Its very important to put attention to '​ramdisk size' parameter, this value is in KB and represents the amount of RAM needed to expand the '​initrd.img'​ file. So to check how much RAM you need:
 +<​code>​
 +# du -sh initrd.tmp/
 +616M  initrd.tmp/
 +</​code>​
 +In the above example the size of '​initrd.img'​ when is uncompressed is 616 MB, therefore set '​ramdisk_size'​ to 700 MB (716800 KB) or 800 MB (819200 KB). Better 819200 KB!!
 +
 +===== Automating the process =====
 +
 +The follow script from http://​www.kickinass.net/​proxmox-ve-3-1-ueber-pxe-installieren/​ can do the work for you, the only condition is rename your Proxmox VE ISO to proxmox.iso:​
 +
 +<​code>​
 +#!/bin/bash
 +
 +BASEDIR=${1:​-./​}
 +pushd $BASEDIR >/​dev/​null
 +
 +[ -L "​proxmox.iso"​ ] && rm proxmox.iso &>/​dev/​null
 +
 +for ISO in *.iso; do
 +    if [ "​$ISO"​ = "​*.iso"​ ]; then continue; fi
 +    if [ "​$ISO"​ = "​proxmox.iso"​ ]; then continue; fi
 +    echo "Using $ISO"
 +    ln -s "​$ISO"​ proxmox.iso
 +done
 +
 +if [ ! -f "​proxmox.iso"​ ]; then
 +    echo "​Couldn'​t find a proxmox iso, aborting."​
 +    echo "Add /​path/​to/​iso_dir to the commandline."​
 +    exit 2
 +fi
 +
 +[ -d pxeboot ] || mkdir  pxeboot
 +pushd pxeboot >/​dev/​null
 +[ -d mnt ] || mkdir  mnt
 +echo "​Mounting iso image"
 +
 +if ! mount -t iso9660 -o ro,loop ../​proxmox.iso mnt/ ; then
 +    echo "​Failed to mount iso image, aborting."​
 +    exit 3
 +fi
 +
 +cp  mnt/​boot/​isolinux/​linux26 .
 +rm -f  initrd.orig initrd.orig.img initrd.img
 +cp  mnt/​boot/​isolinux/​initrd.img initrd.orig.img
 +
 +if ! umount ​ mnt ; then
 +    echo "​Couldn'​t unmount iso image, aborting."​
 +    exit 4
 +fi
 +
 +echo "​Unmounted iso, extracting contents of initrd..."​
 +gzip -d -S "​.img"​ ./​initrd.orig.img
 +rm -rf initrd.tmp
 +mkdir  initrd.tmp
 +pushd initrd.tmp >/​dev/​null
 +echo "Added iso, creating and compressing the new initrd..."​
 +cpio -i -d < ../​initrd.orig 2>/​dev/​null
 +cp ../​../​proxmox.iso proxmox.iso
 +(find . | cpio -H newc -o > ../​initrd.iso) 2>/​dev/​null
 +popd >/​dev/​null
 +rm -f initrd.iso.img
 +gzip -9 -S "​.img"​ initrd.iso
 +
 +# Now clean up temp stuff
 +echo "​Cleaning up temp files..."​
 +rmdir  mnt
 +rm -rf initrd.tmp
 +rm  ./​initrd.orig
 +
 +echo "​Done! ​ Look in $PWD for pxeboot files."​
 +popd >/​dev/​null
 +popd >/​dev/​null
 +</​code>​
proxmox/install_proxmox_ve_from_pxe.txt ยท Last modified: 2015/06/29 12:10 (external edit)