August 26, 2013 by kimizhang
Openstack doesn’t support launching a diskless PXE-boot VM, we have to make an image with PXE-boot capability to achieve this.
1.Create a small empty disk file, create dos filesystem.
dd if=/dev/zero of=pxeboot.img bs=1M count=4
mkdosfs pxeboot.img
|
2.Make it bootable by syslinux
losetup /dev/loop0 pxeboot.img
mount /dev/loop0 /mnt
syslinux --install /dev/loop0
|
3.Install iPXE kernel and make sysliux.cfg to load it at bootup
wget http://boot.ipxe.org/ipxe.iso
mount -o loop ipxe.iso /media
cp /media/ipxe.krn /mnt
cat > /mnt/syslinux.cfg <<EOF
DEFAULT ipxe
LABEL ipxe
KERNEL ipxe.krn
EOF
umount /media/
umount /mnt
|
4.Now we have pxeboot.img ready, let’s register it to glance
source nceprc
glance image-create --name NG-AS --is-public true --disk-format raw --container-format bare < pxeboot.img
|
Like this:
Like Loading...
Related
Category: Openstack
| Tags: diskless, image, Openstack, PXE-boot
Hi Kimi
Thanks for the instruction. it helps a lot.
Here is another issue i met after i spin up a pxe instance.
I have a cobbler server in a vm with dhcp service listening on eth1, and the pxe instance also has an eth1. Once pxe boot from eth1 , nova-network’s dnsmasq will assign a ip for pxe vm, which will interfere with cobbler’s dhcp offer.
Do you know how to solve this?
Thanks!
When you create the network , disable the DHCP