wiki:SetUpTestingCenterKVM

TESTING CENTER SETUP WITH KVM

BEFORE INSTALLING

  1. Requires CPU that supports virtualization.
  2. The following instructions are for Redhat based flavors of Linux (Redhat, Fedora, CentOS).

INSTALLATION

  1. In the host machine's bios, enable the virtualization option for your CPU.
  2. Install your favorite flavor of Linux on the host machine. In our case, we used Centos 5.5
  3. As root, install the virtualization packages.
       yum install @virtualization  
       (or yum groupinstall Virtualization (or KVM))
       (or yum install kvm libvirt python-virtinst qemu-kvm for Centos 6.3)
       chkconfig libvirtd on
       service libvirtd start
       reboot # may be necessary
    
  4. Confirm kvm kernel modules are running
       lsmod | grep kvm
       #Should output the following (or similar):
       kvm
       kvm_intel
      
       #If not, please refer to the KVM Troubleshooting section below.
    
  5. Download CSEP-VM image to /export/vms directory
  6. Create the virtual machine
       virt-manager
    
  1. Highlight the localhost connector and click NEW
       '''VIRTUALIZATION METHOD'''
       FULLY-VIRTUALIZED
          CPU-ARCHITECTURE: x86_64
          HYPERVISOR: KVM
       '''INSTALLATION METHOD'''
       PXE BOOT (just to satisfy the wizard)
       OS TYPE: Linux
       OS VARIANT: Fedora Core 14 (or highest available)
    
       '''STORAGE'''
       FILE DISK-IMAGE: /export/vms/csep.img #or browse for downloaded image
       SIZE: 30000MB
       
       '''NETWORK'''
       VIRTUAL NETWORK: DEFAULT
       SET FIX MAC ADDRESS: 00:1E:C9:AD:89:28
    
       '''MEMORY AND CPU ALLOCATIONS'''
       MAX MEMORY: 10000MB
       START MEMORY: 10000MB
       VIRTUAL CPUS: 1
    
        
    
  2. After you FINISH the wizard, the VM will start automatically. You can FORCE SHUT the initial boot up because we are not actually installing the OS from PXE. After it's shutdown, click RUN to boot from image.
  1. The CSEP VM is configured with the IP: 192.168.122.101. Add this to your host file:
  echo 192.168.122.101 csep >> /etc/hosts
  1. Create a home directory. There are several options:

9p Setup

Use virt-manager to create shared a directory on the host. In our example, we called it /op-home and mounted with the following command in /etc/fstab on the client

/op-home        /home   9p      trans=virtio,access=any 0 0

Virtio device Use virt-manager to create a new virtio disk. It will show up on client as /dev/vdb

NFS Create an NFS exported home directory on the HOST machine or using existing home. For example, if /home/csep exists, then:

echo /home/csep csep(rw,sync,no_root_squash) >> /etc/exports
chkconfig nfs on
service nfs restart
# Remember to open up the firewall and disable selinux
  1. From the host machine, you should be able to ssh into csep now. If not, use the console in the virt-manager to login to troubleshoot the network.
  ssh -l root csep
  #Password is 'testing'
  1. Once logged in, uncomment the last line of /etc/fstab (or modify it according to your home directory in step 12. Mount the home directory.
  mount /home/csep
  1. Copy testing center appropriate config files from /usr/local/csep-config directory. Copy this to your your home directory. For example:
      cp /usr/local/csep-config/japan/.tcshrc /home/csep
      cp /usr/local/csep-config/japan/.matplotlib /home/csep
    

TROUBLESHOOTING

If KVM is not loaded, try the following:

  • yum install kmod-kvm kvm kvm-qemu-img
  • yum update kernel kernel-devel
  • modprobe kvm-intel

NOTE Previous methods of installations are no longer fully supported, but are still available:

Last modified 4 years ago Last modified on 2013-02-22T14:32:22-08:00