Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/devenv_cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ In the [Install MicroShift for Edge](./rhel4edge_iso.md#install-microshift-for-e
```bash
VMNAME=microshift-edge
NETNAME=default
ISO=$(ls -1 "_output/image-builder/microshift-installer-*.$(uname -m).iso")

./scripts/image-builder/create-vm.sh $VMNAME $NETNAME
./scripts/image-builder/create-vm.sh $VMNAME $NETNAME $ISO
```

> The RHEL for Edge host is created with 2 cores and 3 GB of RAM to allow for a better performance in a nested virtualization environment.
Expand Down
15 changes: 6 additions & 9 deletions scripts/image-builder/create-vm.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
#!/bin/bash
set -e

ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" && pwd )"
ISODIR=${ROOTDIR}/_output/image-builder

if [ $# -ne 2 ] ; then
echo "Usage: $(basename "$0") <vm_name> <network_name>"
if [ $# -ne 3 ] ; then
echo "Usage: $(basename "$0") <vm_name> <network_name> <iso_path>"
exit 1
fi

VMNAME=$1
NETNAME=$2
CDROM=$(ls -1 "${ISODIR}/microshift-installer-*.$(uname -m).iso" 2>/dev/null || true)
CDROM=$3

if [ ! -e "${CDROM}" ] ; then
echo "The image ISO '${CDROM}' file does not exist. Run 'make iso' to create it"
echo "The image ISO '${CDROM}' file does not exist."
exit 1
fi

sudo dnf install -y libvirt virt-manager virt-install virt-viewer libvirt-client qemu-kvm qemu-img sshpass
if [ "$(systemctl is-active libvirtd.socket)" != "active" ] ; then
echo "Restart your host to initialize the virtualization environment"
exit 1
echo "Enabling libvirtd"
sudo systemctl enable --now libvirtd
fi
# Necessary to allow remote connections in the virt-viewer application
sudo usermod -a -G libvirt "$(whoami)"
Expand Down