Remove unnecessary files and commands
These files might be helpful for some guide or instructions, but currently are just serving as an unnecessary noise in a repo that's already complicated enough. The commands removed have to do with the recent memory allocation analysis (not necessary here anymore). Story: 2005051 Task: 48373 Change-Id: Ic710d56d0881b0c08ee81d3642dfb0017a97912c
This commit is contained in:
parent
ff18e91f97
commit
c827cf81e9
@ -1,26 +0,0 @@
|
||||
# Virtual machine prefix name
|
||||
VM_PREFIX_NAME=$(whoami)-simplex-
|
||||
|
||||
# Number of controller nodes
|
||||
TIC_CONTROLLER_NUM=1
|
||||
# Number of compute nodes
|
||||
TIC_COMPUTE_NUM=0
|
||||
|
||||
# vCPU
|
||||
TIC_CONTROLLER_CPUS="8"
|
||||
# Memory size, in MB
|
||||
TIC_CONTROLLER_MEM="24576"
|
||||
# Disk1 size, in 1 MB units
|
||||
TIC_CONTROLLER_DISK1="600000"
|
||||
# Disk2 size, in 1 MB units
|
||||
TIC_CONTROLLER_DISK2="16240"
|
||||
# Disk2 size, in 1 MB units
|
||||
TIC_CONTROLLER_DISK3="16240"
|
||||
|
||||
# First port for VRDE
|
||||
# This is for a Virtualbox Remote Display Port
|
||||
# https://www.virtualbox.org/manual/ch07.html#vrde
|
||||
TIC_VDEPORT_START=1$(id -u)
|
||||
|
||||
# Install image
|
||||
TIC_INSTALL_ISO="$PWD/bootimage.iso"
|
@ -1345,18 +1345,6 @@ def stage_setup_controller_0(ssh_client):
|
||||
commands,
|
||||
timeout=HostTimeout.NORMAL_OP
|
||||
)
|
||||
|
||||
LOG.info("#### Configure platform memory allocation")
|
||||
if V_BOX_OPTIONS.setup_type in [AIO_SX, AIO_DX]:
|
||||
commands = [
|
||||
r'system host-memory-show controller-0 0;',
|
||||
r'system host-memory-modify controller-0 0 -m 11200;',
|
||||
]
|
||||
run_ssh_cmd_list(
|
||||
ssh_client,
|
||||
commands,
|
||||
timeout=HostTimeout.NORMAL_OP
|
||||
)
|
||||
except:
|
||||
LOG.error("Failed stage: %s", STG_SETUP_CONTROLLER_0)
|
||||
raise
|
||||
@ -1548,17 +1536,6 @@ def stage_setup_controller_1(ssh_client):
|
||||
commands,
|
||||
timeout=HostTimeout.NORMAL_OP
|
||||
)
|
||||
LOG.info("#### Configure platform memory allocation")
|
||||
if V_BOX_OPTIONS.setup_type in [AIO_SX, AIO_DX]:
|
||||
commands = [
|
||||
r'system host-memory-show controller-1 0;',
|
||||
r'system host-memory-modify controller-1 0 -m 11200;',
|
||||
]
|
||||
run_ssh_cmd_list(
|
||||
ssh_client,
|
||||
commands,
|
||||
timeout=HostTimeout.NORMAL_OP
|
||||
)
|
||||
except:
|
||||
LOG.error("Failed stage: %s", STG_SETUP_CONTROLLER_1)
|
||||
raise
|
||||
|
@ -1,3 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
socat UNIX-CONNECT:"/tmp/serial_$1" stdio,raw,echo=0,icanon=0
|
@ -1,158 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
||||
|
||||
CONFFILE="${1:-standard_controller.conf}"
|
||||
source $SCRIPTPATH/$CONFFILE
|
||||
|
||||
VM_PREFIX_NAME="${VM_PREFIX_NAME:-default-}"
|
||||
CONTROLLER_CPUS="${TIC_CONTROLLER_CPUS:-4}"
|
||||
CONTROLLER_MEM="${TIC_CONTROLLER_MEM:-8192}"
|
||||
CONTROLLER_DISK1="${TIC_CONTROLLER_DISK1:-81920}"
|
||||
CONTROLLER_DISK2="${TIC_CONTROLLER_DISK2:-10240}"
|
||||
CONTROLLER_DISK3="${TIC_CONTROLLER_DISK3:-4096}"
|
||||
ISO="${TIC_INSTALL_ISO:-$SCRIPTPATH/bootimage.iso}"
|
||||
|
||||
HOSTADD_SCRIPT="$SCRIPTPATH/add_host.sh"
|
||||
|
||||
declare -a CREATED_VMS
|
||||
machine_folder=`VBoxManage list systemproperties | grep "Default machine folder:" | cut -d : -f 2 | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'`
|
||||
|
||||
# VRDE port for 1st VM
|
||||
vrdeport="${TIC_VDEPORT_START:-13389}"
|
||||
function set_vrde {
|
||||
vm=$1
|
||||
VBoxManage modifyvm "$vm" --vrde on --vrdeaddress 127.0.0.1 --vrdeport $vrdeport
|
||||
let vrdeport=vrdeport+1
|
||||
}
|
||||
|
||||
function my_error {
|
||||
echo "Error: $1"
|
||||
my_trap_clean
|
||||
exit 1
|
||||
}
|
||||
|
||||
function my_trap_clean {
|
||||
echo "deleting created VMS ${CREATED_VMS[@]}..."
|
||||
for vm in ${CREATED_VMS[@]}; do
|
||||
VBoxManage unregistervm "$vm" --delete
|
||||
done
|
||||
}
|
||||
|
||||
function init_hostonly_net {
|
||||
# Create hostonly networks
|
||||
VBoxManage list hostonlyifs | grep vboxnet0 && vboxnet="1"
|
||||
if [ "x$vboxnet" != "x" ]; then
|
||||
VBoxManage list hostonlyifs
|
||||
read -r -p "Hostonly network vboxnet0 already existed. Are you sure to reconfigure it? [y/N] " response
|
||||
case $response in
|
||||
[yY][eE][sS]|[yY])
|
||||
echo
|
||||
;;
|
||||
*)
|
||||
my_error "Please make sure it's safe before you remove hostonly network vboxnet0!"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
VBoxManage hostonlyif create
|
||||
fi
|
||||
VBoxManage hostonlyif ipconfig vboxnet0 --ip 10.10.10.1 --netmask 255.255.255.0
|
||||
}
|
||||
|
||||
function createvm {
|
||||
vm=$1
|
||||
cpus=$2
|
||||
mem=$3
|
||||
|
||||
echo "creating VM ${vm}..."
|
||||
# Find if VM already existing
|
||||
VBoxManage showvminfo "$vm" &>/dev/null && my_error "VM $vm already existed. Please delete it first"
|
||||
CREATED_VMS+=("$vm")
|
||||
# Create VM
|
||||
VBoxManage createvm --name "$vm" --register
|
||||
|
||||
# Configure controller VM
|
||||
# CPU
|
||||
VBoxManage modifyvm "$vm" --ostype Linux_64 --cpus "$cpus" --pae on --longmode on --x2apic on --largepages off
|
||||
# Memory
|
||||
VBoxManage modifyvm "$vm" --memory "$mem"
|
||||
# Network
|
||||
VBoxManage modifyvm "$vm" --cableconnected1 on --nic1 hostonly --nictype1 82540EM --hostonlyadapter1 vboxnet0
|
||||
VBoxManage modifyvm "$vm" --cableconnected2 on --nic2 intnet --nictype2 82540EM --intnet2 intnet-management-$(whoami) --nicpromisc2 allow-all --nicbootprio2 1
|
||||
VBoxManage modifyvm "$vm" --cableconnected3 on --nic3 intnet --nictype3 virtio --intnet3 intnet-data1-$(whoami) --nicpromisc3 allow-all
|
||||
VBoxManage modifyvm "$vm" --cableconnected4 on --nic4 intnet --nictype4 virtio --intnet4 intnet-data2-$(whoami) --nicpromisc4 allow-all
|
||||
# Storage Medium
|
||||
VBoxManage createmedium disk --filename "${machine_folder}/${vm}/${vm}-disk1.vdi" --size $CONTROLLER_DISK1 --format VDI
|
||||
VBoxManage createmedium disk --filename "${machine_folder}/${vm}/${vm}-disk2.vdi" --size $CONTROLLER_DISK2 --format VDI
|
||||
VBoxManage createmedium disk --filename "${machine_folder}/${vm}/${vm}-disk3.vdi" --size $CONTROLLER_DISK3 --format VDI
|
||||
VBoxManage storagectl "$vm" --name SATA --add sata --controller IntelAhci --portcount 4 --hostiocache on --bootable on
|
||||
VBoxManage storageattach "$vm" --storagectl SATA --port 0 --device 0 --type hdd --medium "${machine_folder}/${vm}/${vm}-disk1.vdi"
|
||||
VBoxManage storageattach "$vm" --storagectl SATA --port 1 --device 0 --type hdd --medium "${machine_folder}/${vm}/${vm}-disk2.vdi"
|
||||
VBoxManage storageattach "$vm" --storagectl SATA --port 2 --device 0 --type hdd --medium "${machine_folder}/${vm}/${vm}-disk3.vdi"
|
||||
VBoxManage storageattach "$vm" --storagectl SATA --port 3 --device 0 --type dvddrive --medium emptydrive
|
||||
# Display
|
||||
VBoxManage modifyvm "$vm" --vram 16
|
||||
# Audio
|
||||
VBoxManage modifyvm "$vm" --audio none
|
||||
# Boot Order
|
||||
VBoxManage modifyvm "$vm" --boot1 dvd --boot2 disk --boot3 net --boot4 none
|
||||
# Other
|
||||
VBoxManage modifyvm "$vm" --ioapic on --rtcuseutc on
|
||||
# VM sepcific
|
||||
# Serial
|
||||
VBoxManage modifyvm "$vm" --uart1 0x3F8 4 --uartmode1 server "/tmp/serial_$vm"
|
||||
set_vrde "$vm"
|
||||
}
|
||||
|
||||
function clonevm {
|
||||
src=$1
|
||||
target=$2
|
||||
echo "creating VM ${target} from ${src}..."
|
||||
# Find if vm already existing
|
||||
VBoxManage showvminfo "$target" &>/dev/null && my_error "VM $target already existed. Please delete it first"
|
||||
VBoxManage clonevm "$src" --mode machine --name "$target" --register
|
||||
CREATED_VMS+=("$target")
|
||||
# Serial
|
||||
VBoxManage modifyvm "$target" --uart1 0x3F8 4 --uartmode1 server "/tmp/serial_$target"
|
||||
set_vrde "$target"
|
||||
}
|
||||
|
||||
trap my_trap_clean SIGINT SIGTERM
|
||||
|
||||
set -e
|
||||
|
||||
[[ -f $ISO ]] || my_error "Can not fild install image $ISO"
|
||||
|
||||
# Init hostonly network
|
||||
init_hostonly_net
|
||||
|
||||
# Create host_add.sh for Compute and Controller node
|
||||
rm -f "$HOSTADD_SCRIPT"
|
||||
cat <<EOF > "$HOSTADD_SCRIPT"
|
||||
#!/usr/bin/env bash
|
||||
source /etc/platform/openrc
|
||||
EOF
|
||||
chmod +x "$HOSTADD_SCRIPT"
|
||||
|
||||
# Create Contoller VM, at least controller0
|
||||
createvm "${VM_PREFIX_NAME}controller-0" $CONTROLLER_CPUS $CONTROLLER_MEM
|
||||
COUNTER=1
|
||||
while [ $COUNTER -lt $TIC_CONTROLLER_NUM ]; do
|
||||
clonevm ${VM_PREFIX_NAME}controller-0 "${VM_PREFIX_NAME}controller-$COUNTER"
|
||||
mac=`VBoxManage showvminfo "${VM_PREFIX_NAME}controller-$COUNTER" | grep intnet-management | grep -o "MAC: [0-9a-fA-F]*" | awk '{ print $2 }' | sed 's/../&:/g;s/:$//'`
|
||||
echo "system host-add -n ${VM_PREFIX_NAME}controller-$COUNTER -p controller -m $mac" >> "$HOSTADD_SCRIPT"
|
||||
let COUNTER=COUNTER+1
|
||||
done
|
||||
|
||||
# Create Compute VM
|
||||
COUNTER=0
|
||||
while [ $COUNTER -lt $TIC_COMPUTE_NUM ]; do
|
||||
clonevm ${VM_PREFIX_NAME}controller-0 "${VM_PREFIX_NAME}compute-$COUNTER"
|
||||
mac=`VBoxManage showvminfo "${VM_PREFIX_NAME}compute-$COUNTER" | grep intnet-management | grep -o "MAC: [0-9a-fA-F]*" | awk '{ print $2 }' | sed 's/../&:/g;s/:$//'`
|
||||
echo "system host-add -n ${VM_PREFIX_NAME}compute-$COUNTER -p compute -m $mac" >> "$HOSTADD_SCRIPT"
|
||||
let COUNTER=COUNTER+1
|
||||
done
|
||||
|
||||
# Start Controller-0 with bootiso.img
|
||||
VBoxManage storageattach ${VM_PREFIX_NAME}controller-0 --storagectl SATA --port 3 --device 0 --type dvddrive --medium "$ISO"
|
||||
$SCRIPTPATH/start_vm.sh ${VM_PREFIX_NAME}controller-0
|
@ -1,20 +0,0 @@
|
||||
# Number of Controller nodes
|
||||
TIC_CONTROLLER_NUM=1
|
||||
# Number of Compute nodes
|
||||
TIC_COMPUTE_NUM=1
|
||||
|
||||
# vCPU
|
||||
TIC_CONTROLLER_CPUS="4"
|
||||
# Memory size, in MB
|
||||
TIC_CONTROLLER_MEM="8192"
|
||||
# Disk1 size, in 1 MB units
|
||||
TIC_CONTROLLER_DISK1="81920"
|
||||
# Disk2 size, in 1 MB units
|
||||
TIC_CONTROLLER_DISK2="10240"
|
||||
# First port for VRDE
|
||||
# This is for a Virtualbox Remote Display Port
|
||||
# https://www.virtualbox.org/manual/ch07.html#vrde
|
||||
TIC_VDEPORT_START=13389
|
||||
|
||||
# Install image
|
||||
TIC_INSTALL_ISO="$PWD/bootimage.iso"
|
@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
rdeport=`VBoxManage showvminfo $1 | grep "^VRDE:" | grep -o "Ports [0-9]*" | cut -d ' ' -f 2`
|
||||
if [ "x$rdeport" == "x" ]; then
|
||||
echo "Vm $1 not found or not configured to use rde".
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VBoxManage startvm "$1" --type headless
|
||||
|
||||
sleep 3
|
||||
echo rdesktop-vrdp -a 16 -N "127.0.0.1:$rdeport"
|
||||
if xdpyinfo 2>&1 >> /dev/null; then
|
||||
rdesktop-vrdp -a 16 -N "127.0.0.1:$rdeport" &
|
||||
else
|
||||
echo "Running without X display. Use a tunnel from your laptop"
|
||||
echo "ssh -L $rdeport:127.0.0.1:$rdeport -N -f -l <uname> madbuild01.ostc.intel.com"
|
||||
echo "Then run rdesktop-vrdp -a 16 -N 127.0.0.1:$rdeport from your laptop"
|
||||
fi
|
@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
VBoxManage controlvm "$1" poweroff
|
||||
|
Loading…
Reference in New Issue
Block a user