Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:olh:xen-unstable
xenpaging-scripts
install-xen-virtual_machine.sh
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File install-xen-virtual_machine.sh of Package xenpaging-scripts
#!/bin/bash set -ex unset LANG unset ${!LC_*} opt=$1 # instance= # virtmode= vm_dist= vm_sp= # mac_base= mac_vm= mac_dist= mac_sp= mac_vm_mode= # bridge= vm_name= install= do_autoyast="yes" autoyast_cmdline= autoyast_url= autoyast_xml= opt_virtmode= opt_ostype= opt_install=() opt_os_settings=() opt_extra_args=() # ## # if test "${opt}" = "-a" then do_autoyast="yes" shift opt=$1 elif test "${opt}" = "-A" then do_autoyast="no" shift opt=$1 fi shift instance=${opt##*_} case "${instance}" in 0|1|2|3|4|5|6|7|8|9) ;; a|b|c|d|e|f) ;; *) opt=broken ;; esac # case "${opt}" in sles10sp3_para_*) virtmode=para vm_dist=sles10 vm_sp=sp3 ;; sles10sp3_full_*) virtmode=full vm_dist=sles10 vm_sp=sp3 ;; sles10sp4_para_*) virtmode=para vm_dist=sles10 vm_sp=sp4 ;; sles10sp4_full_*) virtmode=full vm_dist=sles10 vm_sp=sp4 ;; sles11ga_para_*) virtmode=para vm_dist=sles11 vm_sp=ga ;; sles11ga_full_*) virtmode=full vm_dist=sles11 vm_sp=ga ;; sles11sp1_para_*) virtmode=para vm_dist=sles11 vm_sp=sp1 ;; sles11sp1_full_*) virtmode=full vm_dist=sles11 vm_sp=sp1 ;; *) echo "$0 $* not recognized" echo "Usage: $0 [-a] sles11ga_para_N|sles11ga_full_N" echo " $0 [-a] sles11sp1_para_N|sles11sp1_full_N" exit 1 ;; esac # MAC case "${vm_dist}" in sles10) mac_dist=a ;; sles11) mac_dist=b ;; *) exit 1 ;; esac case "${vm_sp}" in ga) mac_sp=0 ;; sp1) mac_sp=1 ;; sp2) mac_sp=2 ;; sp3) mac_sp=3 ;; sp4) mac_sp=4 ;; *) exit 1 ;; esac case "${virtmode}" in para) mac_vm_mode=0 ;; full) mac_vm_mode=1 ;; *) exit 1 ;; esac mac_instance=${instance} mac_vm=${mac_dist}${mac_sp}:${mac_vm_mode}${mac_instance} # # dist if test -e /mounts/schnell then autoyast_url="http://bax.arch.suse.de/~ohering/work/xen" case "${vm_dist}" in sles10) case "${vm_sp}" in sp2) install=http://schnell.suse.de/SLES10/SLE-10-SP2/SLES-10-SP2-GM/x86_64/DVD1 ;; sp3) install=http://schnell.suse.de/SLES10/SLE-10-SP3/SLES-10-SP3-GM/x86_64/DVD1 ;; sp4) install=http://schnell.suse.de/SLES10/SLE-10-SP4/SLES-10-SP4-GM/x86_64/DVD1 autoyast_xml=autoyast-sles10sp4_para.xml ;; esac ;; sles11) case "${vm_sp}" in ga) install=http://schnell.suse.de/SLE11/SLES-11-GM/x86_64/DVD1 autoyast_xml=autoyast-sles11ga_para.xml ;; sp1) install=http://schnell.suse.de/SLE11/SLES-11-SP1-GM/x86_64/DVD1 autoyast_xml=autoyast-sles11sp1_para.xml ;; esac ;; esac else autoyast_url="http://192.168.2.100/dist/buildservice/home:olh:xen-unstable/xenpaging-scripts" case "${vm_dist}" in sles10) case "${vm_sp}" in sp3) install=http://192.168.2.100/dist/sles10-sp3/x86_64/dvd1 ;; sp4) install=http://192.168.2.100/dist/sles10-sp4/x86_64/dvd1 autoyast_xml=autoyast-sles10sp4_para.xml ;; esac ;; sles11) case "${vm_sp}" in sp1) install=http://192.168.2.100/dist/sles11-sp1/x86_64/dvd1 autoyast_xml=autoyast-sles11sp1_para.xml ;; esac ;; esac fi # if test "${virtmode}" = "para" then if test "${do_autoyast}" = "yes" && test -n "${autoyast_url}" && test -n "${autoyast_xml}" then autoyast_cmdline="vnc=1 vncpassword=password ssh=1 sshpassword=root nosshkey" opt_os_settings=( "--os-settings" "${autoyast_url}/${autoyast_xml}" ) else autoyast_cmdline="start_shell" fi fi vm_name=${vm_dist}${vm_sp}_${virtmode}_${instance} # vm-install case "${virtmode}" in full) opt_virtmode=--full-virt ;; para) if test -z "${install}" then echo "'install' is not configured" exit 1 fi opt_virtmode=--para-virt opt_install=("--source" "${install}" ) opt_extra_args=( "--extra-args" "quiet sysrq=yes panic=9 oops=panic ${autoyast_cmdline}" ) ;; esac case "${vm_dist}" in sles10) opt_ostype=sles10 ;; sles11) opt_ostype=sles11 ;; esac # isodist=${vm_dist}${vm_sp} case "$(hostname)" in optiplex|anonymi) mac_base=00:e1:08:15 bridge=br0 ;; falla) mac_base=00:e2:08:15 bridge=br1 ;; stein-schneider) mac_base=00:e3:08:15 bridge=br0 ;; bach) mac_base=00:e4:08:15 bridge=br0 ;; esac if test -z "${bridge}" then echo "hostname not handled, incomplete pseudo MAC address" exit 1 fi mac=${mac_base}:${mac_vm} iso=/suse/ohering/public_html/work/xenpaging/bootiso-${isodist}.iso if ! test -f "${iso}" then iso="${PWD}/bootiso-${isodist}.iso" fi if ! test -f "${iso}" then echo "bootiso-${isodist}.iso not found" fi cp -avL --remove-destination "${iso}" /var/lib/xen/images/bootiso-${isodist}-${vm_name}.iso # vm-install \ \ --vcpus 2 \ --graphics-viewer vnc \ --graphics cirrus \ --memory 512 \ --max-memory 512 \ --name ${vm_name} \ ${opt_virtmode} \ --nic mac=${mac},bridge=${bridge} \ --os-type ${opt_ostype} \ --disk file:/var/lib/xen/images/vdisk-${vm_name}-disk0,0,disk,w,4096,sparse=1 \ --disk file:/var/lib/xen/images/vdisk-${vm_name}-disk1,1,disk,w,8192,sparse=1 \ --disk file:/var/lib/xen/images/bootiso-${isodist}-${vm_name}.iso,2,cdrom,r \ --debug \ --preserve-on-error \ --background \ --ui text \ "${opt_install[@]}" \ "${opt_os_settings[@]}" \ "${opt_extra_args[@]}" \ "$@" exit $?
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor