forked from msimonin/vagrant-g5k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
82 lines (68 loc) · 2.37 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# Sample Vagrantfile
#
# Allow to mount the home directory of G5k inside the VM
$script = <<SCRIPT
mkdir /g5k
mount -t 9p -o trans=virtio hostshare /g5k -oversion=9p2000.L
SCRIPT
Vagrant.configure(2) do |config|
config.vm.provider "g5k" do |g5k, override|
# This is mandatory for the shared folders to work correctly
override.nfs.functional = false
# vagrant-g5k only supports rsync shared folders
override.vm.synced_folder ".", "/vagrant", type: "rsync", disabled: false
override.ssh.insert_key = false
# Mount the home dir
override.vm.provision "shell", inline: $script
# project id must be unique accross all
# your projects using vagrant-g5k to avoid conflict
# on vm disks
g5k.project_id = "test-vagrant-g5k"
#g5k.site = "igrida"
g5k.site = "rennes"
g5k.username = "msimonin"
g5k.gateway = "access.grid5000.fr"
g5k.walltime = "01:00:00"
#g5k.private_key = "your private key"
# Image backed on the frontend filesystem
g5k.image = {
:path => "/home/msimonin/public/debian-8.7-amd64-bento.qcow2",
:backing => "snapshot"
}
## Bridged network : this allow VMs to communicate
#g5k.net = {
# :type => "bridge"
#}
## Nat network : VMs will only have access to the external world
## Forwarding ports will allow you to access services hosted inside the
## VM.
g5k.net = {
:type => "nat",
:ports => ["2222-:22"]
}
## OAR selection of resource
g5k.oar = "virtual != 'none'"
#g5k.oar = "virtual != 'None' and network_address in ('paranoia-2.rennes.grid5000.fr')"
#g5k.oar = "network_address in ('igrida12-12.irisa.fr')"
## VM size customization default values are
## cpu => -1 -> all the cpu of the reserved node
## mem => -1 -> all the mem of the reserved node
##
g5k.resources = {
:cpu => 1,
:mem => 2048
}
## Job container id
## see https://www.grid5000.fr/mediawiki/index.php/Advanced_OAR#Container_jobs
# g5k.job_container_id = "907864"
end #g5k
# This defines a VM
# If you want to use a local virtual machine (vbox, libvirt...)
# add your vagrant options below as usual.
config.vm.define "test" do |my|
my.vm.box = "dummy"
end
end