generate a kvm environment on vm

  • login on vm
  • edit /srv/kvm/config/imagename.conf and add this or similar settings
    • NIC1=int
    • NIC2=ext
    • NIC3=aei
  • if you edit nothing NIC1 is automatically int and NIC2 and NIC3 are not used
  • start /usr/local/sbin/kvmrun imagename
    • If no screen is running and if no image is present or if the image is too small for an installation it creates an image, a tunnel interface and starts a kvm with network boot option to make a FAI installation. After the FAI installation the KVM goes down and restarts with the harddrive boot option.
    • If no screen is running but an image with a proper size exists the kvm starts booting this image in a screen.
    • If a screen is running, kvmrun attaches to this screen.

FAI installation

A newly created hard drive image will be filled with a FAI installation. The first KVM start uses the network boot option. There a mac-address appears which was determined by kvmrun. Put the mac-address into the DHCP server and give the node a name, e.g. imagename. Write a proper PXE configuration for the FAI installation. Tell the FAI server that this node belongs to the class KVM.

what kvmrun does

  • it creates two tunnel intrefaces, if not present: tap_int_imagename and tap_ext_imagename and computes mac addresses using a hash algorithm
  • Creates, if necessary, an qcow2 image which grows by demand. The name is _/srv/kvm/images/imagename.img.
  • Creates or attaches to a screen with a session name imagename.

-- HenningFehrmann - 12 Jan 2011
Topic revision: r6 - 02 Jul 2012, HenningFehrmann
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback