Changeset 219


Ignore:
Timestamp:
Oct 20, 2010, 3:33:09 PM (14 years ago)
Author:
rock
Message:

Add: KVM PXE VM deployment

Location:
drbl-virt/sbin
Files:
1 added
7 edited
1 moved

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/check_drbl_total_vm

    r208 r219  
    2727    # local variables
    2828    vm_IPs=$(cat $vm_IP_file | awk '{print $1}')
    29     IP_status="online"
    3029
    3130    for vm_IP in $vm_IPs
    3231    do
    3332        # check network status
     33        IP_status="online"
    3434        ping -c1 -w1 $vm_IP > /dev/null 2>&1 || IP_status="offline"
    3535        vm_IP_Hostname=$(sed -n "/$vm_IP/p" $vm_IP_file)
  • drbl-virt/sbin/drbl_PXE_PV-VM_create

    r208 r219  
    111111        vm_exist_jude="yes"
    112112    fi
    113    
    114113done
    115114
  • drbl-virt/sbin/drbl_PXE_PV-VM_deploy

    r208 r219  
    5252            fi
    5353            ;;
    54         -v|--vm_cfg)
     54        -v|--vm)
    5555            shift
    5656            if [ -z "$(echo $1 |grep ^-.)" ]; then
  • drbl-virt/sbin/drbl_bridge_kvm_patch

    r218 r219  
    1717# = 1. Patch DRBL initrd to support bridge =
    1818# == Patch /usr/bin/mkpxeinitrd-net ==
    19 # backup mkpxeinitrd-net. if already has "drbl-virt add", dones't sed
     19# backup mkpxeinitrd-net. if already has "drbl-virt add", doesn't sed
    2020cat /usr/bin/mkpxeinitrd-net | grep "# drbl-virt add" >> /dev/null
    2121if [ $? != 0 ]; then
  • drbl-virt/sbin/drbl_bridge_xen_patch

    r218 r219  
    2525cp $Work_Home/conf/initrd_bin/xen-network-common.sh /usr/lib/mkpxeinitrd-net/initrd-skel/bin/
    2626cp $Work_Home/conf/initrd_bin/xen-script-common.sh /usr/lib/mkpxeinitrd-net/initrd-skel/bin/
     27
    2728# patch it to copy command
    2829declare -i modify_line=$(cat -n /usr/bin/mkpxeinitrd-net | grep 'include_bin_prog_from_server=' | awk '{print $1}')
  • drbl-virt/sbin/drbl_kvm_patch.sh

    r217 r219  
    6464
    6565# = 3. Load KVM module when booting =
     66if [ -e /opt/drbl/conf/client-extra-service ]; then
     67    grep 'service_extra_added="kvm"' /opt/drbl/conf/client-extra-service
     68    if [ $? -eq 1 ]; then
     69        echo 'service_extra_added="kvm"' >> /opt/drbl/conf/client-extra-service
     70    fi
     71else
     72    echo 'service_extra_added="kvm"' > /opt/drbl/conf/client-extra-service
     73fi
    6674# for Debian & Ubuntu
    67 if [ -e /etc/modules ]; then
    68     grep kvm /etc/modules
    69     if [ $? -eq 1 ]; then
    70        echo "kvm" >> /etc/modules
    71     fi
     75#if [ -e /etc/modules ]; then
     76#    grep kvm /etc/modules
     77#    if [ $? -eq 1 ]; then
     78#       echo "kvm" >> /etc/modules
     79#    fi
    7280# for CentOS & Fedora
    73 elif [ -e /etc/sysconfig/modules ]; then
    74     grep -r "modprobe kvm" /etc/sysconfig/modules/
    75     if [ $? -eq 1 ]; then
    76         cat  > /etc/sysconfig/modules/kvm.modules << EOF
    77 #!/bin/sh                 
    78 echo -n "Loading kvm module..."
    79 if \$(/sbin/modprobe kvm)
    80     then
    81         echo "[SUCCESS]:"
    82     else
    83         echo "[FAILURE]:"
    84 fi
    85 EOF
    86     chmod +x /etc/sysconfig/modules/kvm.modules
    87     fi
    88 fi
     81#elif [ -e /etc/sysconfig/modules ]; then
     82#    grep -r "modprobe kvm" /etc/sysconfig/modules/
     83#    if [ $? -eq 1 ]; then
     84#        cat  > /etc/sysconfig/modules/kvm.modules << EOF
     85##!/bin/sh                 
     86#echo -n "Loading kvm module..."
     87#if \$(/sbin/modprobe kvm)
     88#    then
     89#        echo "[SUCCESS]:"
     90#    else
     91#        echo "[FAILURE]:"
     92#fi
     93#EOF
     94#    chmod +x /etc/sysconfig/modules/kvm.modules
     95#    fi
     96#fi
    8997
    9098# = 4. Copy xen kernel & initrd to /home/domains =
  • drbl-virt/sbin/drbl_xen_patch.sh

    r217 r219  
    7272# = 3. enable xend xendomains daemon in DRBL Client =
    7373if [ -e /opt/drbl/conf/client-extra-service ]; then
    74     echo 'service_extra_added="xend xendomains"' >> /opt/drbl/conf/client-extra-service
     74    grep 'service_extra_added="xend xendomains"' /opt/drbl/conf/client-extra-service
     75    if [ $? -eq 1 ]; then
     76        echo 'service_extra_added="xend xendomains"' >> /opt/drbl/conf/client-extra-service
     77    fi
    7578else
    7679    echo 'service_extra_added="xend xendomains"' > /opt/drbl/conf/client-extra-service
Note: See TracChangeset for help on using the changeset viewer.