forked from kashyapc/virt-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
112 lines (69 loc) · 2.42 KB
/
README
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
Simple virt scripts for daily use (mostly for a developer/test
engineer):
- Create unattended Fedora guests using virt-install (RAW/QCOW2)
- Creating JEOS(Just Enough Operating System) with Oz.
- Simple guestfish script to do post install operations.
Eventually try to add more cleaner scripts.
NOTE: To speed up you installs, please change the value of
location{1,2,3} to your nearest Fedora mirrors.
Creating unattended guests
==========================
Using virt-install
------------------
To create (this uses virt-install) a minimal (@core only) 10G qcow
disk, 2 vMEM, 2 vCPU, nightly RHEL-7 unattended guest (takes 5 min):
$ git clone \
https://github.com/kashyapc/virt-scripts.git
$ cd virt-scripts
Assuming you want to create Fedora 19 :
$ ./create-guest-qcow2.bash f19-jeos f19 x86_64
Once finished, login using root (passwd: testpwd).
Using Oz
--------
If you want to use Oz (an automated guest install creator w/ minimal
user input):
Usage: ./oz-jeos.bash <guest-name> <distro>
'distro': f20, f19
Examples: oz-jeos.bash f19-jeos f19 # create f19
Successful stdout of install is noted here:
stoudt-examples/f19/f19-jeosJul_04_2013-12
Create an F19 guest:
$ ./oz-jeos.bash f19-jeos f19
Once install is done, define the libvirt XML for the guest (in this case
- 'f19-jeos'):
$ virsh define stoudt-examples/f19/f19-jeosJul_04_2013-12
List all the guests
$ virsh list --all
Start it and connect to the guest's serial console
$ virsh start f19-jeos --console
Or
Connect to it via virt-viewer
$ virt-viewer f19-jeos
Oz notes
~~~~~~~~
Oz uses something called TDL (template descriptive language). For
example:
./stdout-examples/f19/f19.tdl
Contents of the above file:
-------------
<template>
<name>f19-jeos</name>
<os>
<name>Fedora</name>
<version>19</version>
<arch>x86_64</arch>
<install type='url'>
<url>http://dl.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/x86_64/os/<</url>
</install>
<rootpw>testpwd</rootpw>
</os>
<description>Fedora 19</description>
<disk>
<size>25</size>
</disk>
</template>
--------------
To invoke manually, dump the above contents into
'f19.tdl' in the current directory, and do:
$ oz-install ./f19.tdl
root password is defined in the <rootpw> attribute of the TDL