alpha
Login
or
Join now
j3s.sh
/
dotfiles
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
my dotz
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Remove make-vm
author
j3s
date
6 years ago
(Feb 14, 2020, 3:15 PM -0600)
commit
7b985d55
7b985d555973e1db8c941b5b4f2dd32cab890419
parent
91245276
91245276a7c792289a61b95e5cda6f5981c0ce27
-33
1 changed file
Expand all
Collapse all
Unified
Split
bin
darkdepths
make-vm
-33
bin/darkdepths/make-vm
Reviewed
···
1
1
-
#!/bin/bash
2
2
-
3
3
-
if [[ $1 == "" || $1 == "--help" || $1 == "-h" ]]; then
4
4
-
echo "Usage: make-vm [vm-name] [options]"
5
5
-
echo "some options:"
6
6
-
echo " mem=<number-in-megabytes>"
7
7
-
echo " cpu=<cores>"
8
8
-
echo " disk=<gbytes>"
9
9
-
echo " env=<public|private>"
10
10
-
exit 1
11
11
-
fi
12
12
-
13
13
-
name="$1"
14
14
-
env="private"
15
15
-
disk="8" # in gb
16
16
-
mem="512" # in mb
17
17
-
cpu="1" # in cores
18
18
-
19
19
-
if [[ -e /vm/$name.xml || -e /dev/vg0/$name.disk ]]; then
20
20
-
echo 'vm/disk already exists'
21
21
-
exit 1
22
22
-
fi
23
23
-
24
24
-
echo "Carving $disk GB lv in /dev/vg0/$name.disk"
25
25
-
lvcreate -n "$name.disk" --size 8G vg0
26
26
-
27
27
-
echo "createing writing /vm/$name.xml"
28
28
-
touch "/vm/$name.xml"
29
29
-
virt-install -n $name -r 8192 \
30
30
-
$name $cpus $type $variant $disk $location $graphics $bus $network
31
31
-
32
32
-
qemu-system-x86_64 -hda /vm/vdisk.img -m 1024 -enable-kvm -netdev user,id=user.0 -device e1000,netdev=user.0 -soundhw ac97 -no-acpi -daemonize -usb -usbdevice tablet
33
33
-