-
Notifications
You must be signed in to change notification settings - Fork 9
/
README
107 lines (67 loc) · 2.32 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
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} to your nearest Fedora mirrors.
Creating unattended guests
==========================
Using virt-install
------------------
To create (this uses `virt-install`) a minimal (@core only) 10G qcow2
disk, 2 vMEM, 2 vCPU, unattended Fedora:
$ git clone \
https://github.com/kashyapc/virt-scripts.git
$ cd virt-scripts
Assuming you want to create a Fedora 23 guest:
$ ./create-guest-qcow2.bash f23-jeos f23 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, f23
Examples: oz-jeos.bash f23-jeos f23 # Create f23
Create a Fedora 23 guest:
$ ./oz-jeos.bash f23-jeos f23
Once installation is finished, define the libvirt XML for the guest (in
this case 'f23-jeos'):
$ virsh define $libvirt-XML-FROM-PREVIOUS-COMMAND
List all the guests:
$ virsh list --all
Start it and connect to the guest's serial console:
$ virsh start f23-jeos --console
Or
Connect to it via virt-viewer:
$ virt-viewer f23-jeos
Oz notes
~~~~~~~~
Oz uses something called TDL (template descriptive language). For
example:
./stdout-examples/f23/f23.tdl
Contents of the above file:
-------------
<template>
<name>f23-jeos</name>
<os>
<name>Fedora</name>
<version>23</version>
<arch>x86_64</arch>
<install type='url'>
<url>http://dl.fedoraproject.org/pub/fedora/linux/releases/23/Server/x86_64/os/</url>
</install>
<rootpw>testpwd</rootpw>
</os>
<description>Fedora 23</description>
<disk>
<size>10</size>
</disk>
</template>
--------------
To invoke manually, dump the above contents into
'f23.tdl' in the current directory, and do:
$ oz-install ./f23.tdl
Root password is defined in the <rootpw> attribute of the TDL.