-
Notifications
You must be signed in to change notification settings - Fork 38
/
virt-install-sno-iso-ign.sh
executable file
·45 lines (39 loc) · 1.13 KB
/
virt-install-sno-iso-ign.sh
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
#!/bin/bash
# This is the old image, see Makefile
# $ curl -O -L https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.6/46.82.202007051540-0/x86_64/rhcos-46.82.202007051540-0-qemu.x86_64.qcow2.gz
# $ mv rhcos-46.82.202007051540-0-qemu.x86_64.qcow2.gz /tmp
# $ sudo gunzip /tmp/rhcos-46.82.202007051540-0-qemu.x86_64.qcow2.gz
if [ -z ${RHCOS_ISO+x} ]; then
echo "Please set RHCOS_ISO"
exit 1
fi
if [ -z ${VM_NAME+x} ]; then
echo "Please set the VM_NAME"
exit 1
fi
if [ -z ${NET_NAME+x} ]; then
echo "Please set the NET_NAME"
exit 1
fi
export POOL="${POOL:-default}"
OS_VARIANT="rhel8.1"
RAM_MB="${RAM_MB:-16384}"
DISK_GB="${DISK_GB:-30}"
CPU_CORE="${CPU_CORE:-6}"
rm -f nohup.out
nohup virt-install \
--connect qemu:///system \
-n "${VM_NAME}" \
-r "${RAM_MB}" \
--vcpus "${CPU_CORE}" \
--os-variant="${OS_VARIANT}" \
--import \
--network=network:"${NET_NAME}",mac="${HOST_MAC}" \
--graphics=none \
--events on_reboot=restart \
--cdrom "${RHCOS_ISO}" \
--disk pool="${POOL}",size="${DISK_GB}" \
--check disk_size=off \
--boot hd,cdrom \
--noautoconsole \
--wait=-1 &