vagrant-g5k 0.0.18 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +2 -0
- data/Vagrantfile +25 -30
- data/lib/vagrant-g5k/action.rb +0 -3
- data/lib/vagrant-g5k/action/connect_g5k.rb +33 -2
- data/lib/vagrant-g5k/action/read_ssh_info.rb +13 -32
- data/lib/vagrant-g5k/action/read_state.rb +4 -8
- data/lib/vagrant-g5k/command.rb +2 -2
- data/lib/vagrant-g5k/config.rb +4 -3
- data/lib/vagrant-g5k/disk/local.rb +68 -0
- data/lib/vagrant-g5k/disk/rbd.rb +92 -0
- data/lib/vagrant-g5k/g5k_connection.rb +144 -0
- data/lib/vagrant-g5k/network/bridge.rb +115 -0
- data/lib/vagrant-g5k/network/nat.rb +65 -0
- data/lib/vagrant-g5k/oar.rb +90 -0
- data/lib/vagrant-g5k/util/{launch_vm_fwd.sh → launch_vm.sh} +35 -5
- data/lib/vagrant-g5k/version.rb +1 -1
- data/spec/vagrant-g5k/oar_spec.rb +57 -0
- data/vagrant-g5k.gemspec +3 -3
- metadata +52 -6
- data/lib/vagrant-g5k/action/close_g5k.rb +0 -24
- data/lib/vagrant-g5k/util/g5k_utils.rb +0 -435
- data/lib/vagrant-g5k/util/launch_vm_bridge.sh +0 -58
@@ -1,58 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
# This script is borrowed from pmorrillon.
|
4
|
-
# Thanks to him !
|
5
|
-
|
6
|
-
#OAR -l slash_22=1+{virtual!='none'}/nodes=1,walltime=06:00:00
|
7
|
-
#OAR --checkpoint 60
|
8
|
-
#OAR --signal 12
|
9
|
-
|
10
|
-
set -x
|
11
|
-
|
12
|
-
SUBNET_FILE=$1
|
13
|
-
shift
|
14
|
-
|
15
|
-
# As we chose a stateless designe,let's calculate here the ip and mac
|
16
|
-
# assuming we got a slash_22
|
17
|
-
ipnumber=$(($OAR_JOB_ID % 1022))
|
18
|
-
IP_MAC=$(cat $SUBNET_FILE|head -n $((ipnumber + 1))|tail -n 1)
|
19
|
-
IP_ADDR=$(echo $IP_MAC|awk '{print $1}')
|
20
|
-
MAC_ADDR=$(echo $IP_MAC|awk '{print $2}')
|
21
|
-
|
22
|
-
echo $(hostname)
|
23
|
-
echo "VM IP informations :"
|
24
|
-
echo "SUBNET_FILE: $SUBNET_FILE"
|
25
|
-
echo "OAR_JOB_ID : $OAR_JOB_ID"
|
26
|
-
echo "ipnumber: $ipnumber"
|
27
|
-
echo "IP_MAC: $IP_MAC"
|
28
|
-
echo "IP address: $IP_ADDR"
|
29
|
-
echo "MAC address: $MAC_ADDR"
|
30
|
-
|
31
|
-
# create tap
|
32
|
-
TAP=$(sudo create_tap)
|
33
|
-
|
34
|
-
# Directory for qcow2 snapshots
|
35
|
-
export TMPDIR=/tmp
|
36
|
-
|
37
|
-
# Memory allocation
|
38
|
-
KEEP_SYSTEM_MEM=1 # Gb
|
39
|
-
TOTAL_MEM=$(cat /proc/meminfo | grep -e '^MemTotal:' | awk '{print $2}')
|
40
|
-
VM_MEM=$(( ($TOTAL_MEM / 1024) - $KEEP_SYSTEM_MEM * 1024 ))
|
41
|
-
|
42
|
-
# CPU
|
43
|
-
SMP=$(nproc)
|
44
|
-
|
45
|
-
# Clean shutdown of the VM at the end of the OAR job
|
46
|
-
clean_shutdown() {
|
47
|
-
echo "Caught shutdown signal at $(date)"
|
48
|
-
echo "system_powerdown" | nc -U /tmp/vagrant-g5k.mon
|
49
|
-
}
|
50
|
-
|
51
|
-
trap clean_shutdown 12
|
52
|
-
|
53
|
-
# Launch virtual machine
|
54
|
-
#kvm -m $VM_MEM -smp $SMP -drive file=$IMAGE,if=virtio -snapshot -fsdev local,security_model=none,id=fsdev0,path=$HOME -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=hostshare -nographic -net nic,model=virtio,macaddr=$MAC_ADDR -net tap,ifname=$TAP,script=no -monitor unix:/tmp/vagrant-g5k.mon,server,nowait -localtime -enable-kvm &
|
55
|
-
kvm -m $VM_MEM -smp $SMP -fsdev local,security_model=none,id=fsdev0,path=$HOME -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=hostshare -nographic -monitor unix:/tmp/vagrant-g5k.mon,server,nowait -localtime -enable-kvm -net nic,model=virtio,macaddr=$MAC_ADDR -net tap,ifname=$TAP,script=no $@ &
|
56
|
-
|
57
|
-
wait
|
58
|
-
|