#!/bin/bash                                                                                                          
# Program:
#   Path DRBL evironment to support Xen/KVM
# Author: 
#   Jazz, Rock {jazz, rock}@nchc.org.tw
# Version:
#    1.0
# History:                                                                                          
#   2010/08/13  Rock    First release (1.0) 
 
# [Source]
source /opt/drbl-virt/conf/drbl-virt.conf
source $Work_Path/functions_drbl_virt
source ./functions_drbl_virt
# [Main]
# = 0. Variables setup =
# == Get DRBL eth ==
eths=""
declare -i eth_nu=""
get_DRBL_eth

if [ $eth_nu -gt "1" ]; then
    echo ""
    echo "DRBL environment has muiltpule netwrok card(NIC)."
fi

for eth in $eths
do

    # == Get Host IP range/number  ==
    Host_first_IP=""
    Host_last_IP=""
    get_Host_IP_range

    # == Get VM number, IP range & prefix name ==
    declare -i VM_IP_range=""
    declare -i Host_last_IP_4=""
    declare -i VM_Host_totoal_nu=""
    VM_first_IP=""
    VM_last_IP=""
    VM_prefix_name=""
    get_VM_IP_range_and_prefix_name
    create_VM_IP_table 

    # == Generate MAC address  ==
    # MAC address [00:16:3e:xx:xx:xx] is for Xen use
    generate_Xen_MAC_address
    


done

# = 1. Copy VM fs =
# Kernel & initrd -> /home/domains


# = 2. Add NFS config =

# = 3. Add DHCP config =

# = 4. Add hosts and cp it to all drbl client =

# = 5. generate guest config file =
