Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bash best practices, loop change, parameterization of many things #2

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
61dcf5c
switching shutdown to destroy in the killall script
stevenewsted Jan 3, 2019
cc8e7ca
Switching shutdown to destroy in killall, for speed
stevenewsted Jan 3, 2019
6328637
Merge pull request #1 from stevenewsted/killall
stevenewsted Jan 3, 2019
ee8669a
Adding some comments, cleaning a few things up, and fixing the bad wh…
stevenewsted Jan 3, 2019
8bb0814
Merge pull request #2 from stevenewsted/cleanup_5cluster
stevenewsted Jan 3, 2019
5b290f3
Merge branch 'master' of https://github.com/stevenewsted/openshift-ho…
stevenewsted Jan 4, 2019
3a780fd
Doing more cleanup when killing everything
stevenewsted Jan 4, 2019
3d27874
Merge pull request #3 from stevenewsted/killall
stevenewsted Jan 4, 2019
a6b7c4e
Merge branch 'master' of https://github.com/stevenewsted/openshift-ho…
stevenewsted Jan 4, 2019
9b8d032
adding gitignore so we can update with our own personal info
stevenewsted Jan 4, 2019
69cdba1
Merge pull request #4 from stevenewsted/gitignore
stevenewsted Jan 4, 2019
0c49cf5
updating some examples, and moving documentation to the readme
stevenewsted Jan 4, 2019
a9e5864
Merge pull request #5 from stevenewsted/cleanup_5cluster
stevenewsted Jan 4, 2019
fe0a744
Updating a ton of stuff in the readme, and adding vim swp to gitignore
stevenewsted Jan 4, 2019
403f992
Merge pull request #6 from stevenewsted/readme
stevenewsted Jan 4, 2019
8285186
markup typo fixes
stevenewsted Jan 4, 2019
ffbb645
Merge pull request #7 from stevenewsted/readme
stevenewsted Jan 4, 2019
43e724a
another markdown test
stevenewsted Jan 4, 2019
576df6b
Merge pull request #8 from stevenewsted/readme
stevenewsted Jan 4, 2019
1cfe490
more cleanup
stevenewsted Jan 4, 2019
eefb002
Merge pull request #9 from stevenewsted/readme
stevenewsted Jan 4, 2019
142dc5f
adding CPUMODEL as a env var for the build scripts
stevenewsted Jan 4, 2019
59ba9ab
Merge pull request #10 from stevenewsted/env_cpu
stevenewsted Jan 4, 2019
8e88bcb
adding sshkey defs, adding error checking, and doing a bunch of bash …
stevenewsted Jan 4, 2019
7e302ed
fixing typos and unifying comments, etc
stevenewsted Jan 4, 2019
bd33da4
Merge pull request #11 from stevenewsted/sshkeys
stevenewsted Jan 4, 2019
26d8fb8
more bash cleanpup, and switching the for loop to a while to read in …
stevenewsted Jan 4, 2019
c3a5c0e
Merge pull request #12 from stevenewsted/loopswitch
stevenewsted Jan 4, 2019
e493b69
cleaning up original start script
stevenewsted Jan 7, 2019
a4a9dc8
adding some argument parsing to the start script
stevenewsted Jan 7, 2019
480c355
killall can now take virsh destroy and file specification parameters.
stevenewsted Jan 7, 2019
47e01c8
cleaning up the host file name logic, and making stop-all take parame…
stevenewsted Jan 7, 2019
2ab8077
Merge pull request #13 from stevenewsted/start_params
stevenewsted Jan 7, 2019
66e180d
Fixed typo to reference to deploy_cluster.yml playbook
kevchu3 Mar 19, 2019
bda2403
Consolidated package set to install on bastion host
kevchu3 Mar 19, 2019
e75cae1
Removing ansible packages from OCP nodes
kevchu3 Mar 19, 2019
d08939d
Merge pull request #16 from kevchu3/patch-3
kevchu3 Mar 21, 2019
3180e19
Merge pull request #14 from kevchu3/patch-1
kevchu3 Mar 21, 2019
40f2f20
Merge pull request #15 from kevchu3/patch-2
kevchu3 Mar 21, 2019
668b2ca
adding a start of a playbook for managing dnsmasq on the nodes, for w…
stevenewsted Mar 21, 2019
b208756
Moving some variables from individual hosts inventory files to group_…
Mar 21, 2019
82ae940
Moving some variables from individual hosts inventory files to group_…
Mar 21, 2019
52f6c9c
Merge branch 'master' of https://github.com/stevenewsted/openshift-ho…
Mar 21, 2019
8adb634
Adding reference playbook to deploy and configure OpenShift
kevchu3 Mar 21, 2019
d9bff53
Merge pull request #17 from stevenewsted/config-playbooks
kevchu3 Mar 21, 2019
7dd9099
removing stupid state from playbook for dnsmasq
stevenewsted Mar 22, 2019
765a9a7
Merge branch 'master' into dnsmasq
stevenewsted Mar 25, 2019
bffb1ea
Merge pull request #18 from stevenewsted/dnsmasq
stevenewsted Mar 25, 2019
3dd7df0
Refactored vars in group_vars/OSEv3
kevchu3 Mar 27, 2019
88d8faf
Refactored node labels
kevchu3 Mar 27, 2019
96df276
Merge pull request #19 from kevchu3/master
kevchu3 Mar 27, 2019
097e307
Resizing memory for logging and metrics components to support a small…
kevchu3 Mar 28, 2019
92dec12
Merge pull request #20 from kevchu3/master
kevchu3 Mar 28, 2019
52b991b
Refactored some vars
kevchu3 Apr 18, 2019
a10cbd4
Merge pull request #21 from kevchu3/master
kevchu3 Apr 18, 2019
a51fd3e
Set monitoring to install by default
kevchu3 Apr 26, 2019
0a387a4
Merge pull request #22 from kevchu3/master
kevchu3 Apr 26, 2019
cb955a0
Cleaned up reference to stale playbook
kevchu3 May 9, 2019
7e1765d
Adding htpasswd identity file with admin user
kevchu3 Jun 25, 2019
bf53efa
Merge pull request #23 from kevchu3/master
kevchu3 Jun 25, 2019
57b927d
Adding full list of playbooks, additional node group definitions
kevchu3 Jun 26, 2019
d5e4e73
Merge pull request #24 from kevchu3/master
kevchu3 Jun 26, 2019
ce40bf1
Explicitly set OpenShift package version
kevchu3 Jun 27, 2019
58517c0
Merge pull request #26 from kevchu3/master
kevchu3 Jun 27, 2019
4492791
Removing explicit OpenShift package version
kevchu3 Jun 28, 2019
4adeacc
Merge pull request #29 from kevchu3/master
kevchu3 Jun 28, 2019
04e81b9
adding a subscription variables yaml
stevenewsted Jul 2, 2019
822d01e
Merge pull request #31 from stevenewsted/subs_vars
stevenewsted Jul 2, 2019
10fd105
all steve-centric changes
stevenewsted Jul 2, 2019
5f28075
Merge pull request #32 from stevenewsted/subs_vars
stevenewsted Jul 2, 2019
610cdf6
Adding cri-o configurations
kevchu3 Jul 2, 2019
7511837
Removing duplicate vars
kevchu3 Jul 2, 2019
dcb9889
updating readme for example.com
stevenewsted Jul 2, 2019
5a3e1c6
Updated hosts files to use examples and clean up domain references
kevchu3 Jul 2, 2019
cf1a320
Use Docker configuration by default
kevchu3 Jul 2, 2019
564b54c
Refactored dnsmasq wildcard setup into Ansible role
kevchu3 Jul 2, 2019
556fb67
Merge pull request #33 from kevchu3/master
kevchu3 Jul 2, 2019
ea7501e
Adding upgrade playbook reference for errata updates
kevchu3 Aug 20, 2019
535e914
Merge pull request #34 from kevchu3/master
kevchu3 Aug 20, 2019
7ca81e7
Updating reference links to subcomponents
kevchu3 Sep 9, 2019
73a1ff8
Merge pull request #35 from kevchu3/master
kevchu3 Sep 9, 2019
dca8483
Adding glusterfs.yml
kevchu3 Sep 12, 2019
5088ea4
Merge pull request #36 from kevchu3/master
kevchu3 Sep 12, 2019
b27d1f6
Add redeploy cert playbooks (#37)
kevchu3 Sep 30, 2020
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
typescript
*~
*.secret
variables.yml
vault.yml
*.swp
hosts.lab
95 changes: 71 additions & 24 deletions 1-create-jump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,83 @@

source ./env.sh

if [ ! -d $VMS ]
then
echo "Creating $VMS"
mkdir -p $VMS
# verify a bunch of variables have contents, as a sanity check
if [ ! -v VMS ]; then
echo "${VMS} is not defined. Please set this in env.sh and try again."
exit 1
fi
if [ ! -v CLUSTERKEY ]; then
echo "${CLUSTERKEY} is not defined. Please set this in env.sh and try again."
exit 2
fi
if [ ! -v ORIGINALKEY ]; then
echo "${ORIGINALKEY} is not defined. Please set this in env.sh and try again."
exit 3
fi
if [ ! -v VMROOTDISK ]; then
echo "${VMROOTDISK} is not defined. Please set this in env.sh and try again."
exit 4
fi
if [ ! -v INITIALPASSWD ]; then
echo "${INITIALPASSWD} is not defined. Please set this in env.sh and try again."
exit 5
fi

for i in `cat hosts.jump|grep -v \\\\[`;
do
HOSTSFILE=hosts.jump
if [ ! -r "$HOSTSFILE" ]; then
echo "${HOSTSFILE} is missing."
exit 10
fi

echo "########################################################################"
echo "[$i start]"
# create the VM directory if it doesn't exist
if [ ! -d "$VMS" ]; then
echo "Creating ${VMS}"
mkdir -p "$VMS"
fi

baseimage="$VMS/$i-base.qcow2"
image="$VMS/$i.qcow2"
dockerdisk="$VMS/$i-docker.qcow2"
glusterfsdisk="$VMS/$i-glusterfs.qcow2"
# sanity checks around the ssh key stuff
if [ ! -f "$CLUSTERKEY" ]; then # if the cluster sshkey doesn't exist, try to copy it from the original key
if [ ! -r "$ORIGINALKEY" ]; then # check to see if the original key exists and is readable
echo "${CLUSTERKEY} does not exist, and ${ORIGINALKEY} can't be found/read."
exit 6
fi

echo "[Creating a $VMROOTDISK disk for root, $image]"
qemu-img create -f qcow2 $baseimage $VMROOTDISK
virt-resize --expand /dev/sda1 $RHEL_IMAGE $baseimage
# if CLUSTERKEY doesn't exist, but the ORIGINALKEY does, copy it.
cp "$ORIGINALKEY" "$CLUSTERKEY"
COPYRESULT=$?
if [ "$COPYRESULT" -ne 0 ]; then
echo "Error: Copying ${ORIGINALKEY} to create ${CLUSTERKEY} failed with: ${COPYRESULT}"
exit 7
fi
fi
if [ ! -r "$CLUSTERKEY" ]; then # bomb out if the cluster sshkey isn't readable
echo "${CLUSTERKEY} is missing, or is not readbale. Exiting now."
exit 8
fi

qemu-img create -f qcow2 -b $baseimage $image
# ensure that the permissions are correct for the new cluster key
chmod 644 "$CLUSTERKEY"

echo "[Customizing $i system]"
virt-customize -a $image --run-command 'yum remove cloud-init* -y'
virt-customize -a $image --root-password password:redhat
virt-customize -a $image --ssh-inject root:file:$WORKSPACE/vm_id_rsa.pub
virt-customize -a $image --hostname "$i"
echo "[$i done]"
# a safer, cleaner loop over the hosts file to read in lines, rather than words
grep -E '^[^\[ ]' < $HOSTSFILE | while IFS= read -r i
do
echo "########################################################################"
echo "[${i} start]"

done
BASEIMAGE="${VMS}/${i}-base.qcow2"
IMAGE="${VMS}/${i}.qcow2"
DOCKERDISK="${VMS}/${i}-docker.qcow2"
GLUSTERFSDISK="${VMS}/${i}-glusterfs.qcow2"

echo "[Creating a ${VMROOTDISK} disk for root, ${IMAGE}]"
qemu-img create -f qcow2 "$BASEIMAGE" "$VMROOTDISK"
virt-resize --expand /dev/sda1 "$RHEL_IMAGE" "$BASEIMAGE"
qemu-img create -f qcow2 -b "$BASEIMAGE" "$IMAGE"

exit
echo "[Customizing ${i} system]"
virt-customize -a "$IMAGE" --run-command 'yum remove cloud-init* -y'
virt-customize -a "$IMAGE" --root-password password:"$INITIALPASSWD"
virt-customize -a "$IMAGE" --ssh-inject root:file:"$CLUSTERKEY"
virt-customize -a "$IMAGE" --hostname "$i"
echo "[${i} done]"
done
103 changes: 75 additions & 28 deletions 1-create-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,89 @@

source ./env.sh

if [ ! -d $VMS ]
then
echo "Creating $VMS"
mkdir -p $VMS
# verify a bunch of variables have contents, as a sanity check
if [ ! -v VMS ]; then
echo "${VMS} is not defined. Please set this in env.sh and try again."
exit 1
fi
if [ ! -v CLUSTERKEY ]; then
echo "${CLUSTERKEY} is not defined. Please set this in env.sh and try again."
exit 2
fi
if [ ! -v ORIGINALKEY ]; then
echo "${ORIGINALKEY} is not defined. Please set this in env.sh and try again."
exit 3
fi
if [ ! -v VMROOTDISK ]; then
echo "${VMROOTDISK} is not defined. Please set this in env.sh and try again."
exit 4
fi
if [ ! -v INITIALPASSWD ]; then
echo "${INITIALPASSWD} is not defined. Please set this in env.sh and try again."
exit 5
fi

for i in `cat hosts.addnode|grep -v \\\\[`;
do
HOSTSFILE=hosts.addnode
if [ ! -r "$HOSTSFILE" ]; then
echo "${HOSTSFILE} is missing."
exit 10
fi

echo "########################################################################"
echo "[$i start]"
# create the VM directory if it doesn't exist
if [ ! -d "$VMS" ]; then
echo "Creating ${VMS}"
mkdir -p "$VMS"
fi

baseimage="$VMS/$i-base.qcow2"
image="$VMS/$i.qcow2"
dockerdisk="$VMS/$i-docker.qcow2"
glusterfsdisk="$VMS/$i-glusterfs.qcow2"
# sanity checks around the ssh key stuff
if [ ! -f "$CLUSTERKEY" ]; then # if the cluster sshkey doesn't exist, try to copy it from the original key
if [ ! -r "$ORIGINALKEY" ]; then # check to see if the original key exists and is readable
echo "${CLUSTERKEY} does not exist, and ${ORIGINALKEY} can't be found/read."
exit 6
fi

echo "[Creating a $VMROOTDISK disk for root, $image]"
qemu-img create -f qcow2 $baseimage $VMROOTDISK
virt-resize --expand /dev/sda1 $RHEL_IMAGE $baseimage
# if CLUSTERKEY doesn't exist, but the ORIGINALKEY does, copy it.
cp "$ORIGINALKEY" "$CLUSTERKEY"
COPYRESULT=$?
if [ "$COPYRESULT" -ne 0 ]; then
echo "Error: Copying ${ORIGINALKEY} to create ${CLUSTERKEY} failed with: ${COPYRESULT}"
exit 7
fi
fi
if [ ! -r "$CLUSTERKEY" ]; then # bomb out if the cluster sshkey isn't readable
echo "${CLUSTERKEY} is missing, or is not readbale. Exiting now."
exit 8
fi

qemu-img create -f qcow2 -b $baseimage $image
# ensure that the permissions are correct for the new cluster key
chmod 644 "$CLUSTERKEY"

echo "[Creating a $VMDOCKERDISK disk for docker, $dockerdisk]"
qemu-img create -f raw $dockerdisk $VMDOCKERDISK
# a safer, cleaner loop over the hosts file to read in lines, rather than words
grep -E '^[^\[ ]' < $HOSTSFILE | while IFS= read -r i
do
echo "########################################################################"
echo "[${i} start]"

echo "[Creating a $VMGLUSTERFSDISK disk for glusterfs, $glusterfsdisk]"
qemu-img create -f raw $glusterfsdisk $VMGLUSTERFSDISK
BASEIMAGE="${VMS}/${i}-base.qcow2"
IMAGE="${VMS}/${i}.qcow2"
DOCKERDISK="${VMS}/${i}-docker.qcow2"
GLUSTERFSDISK="${VMS}/${i}-glusterfs.qcow2"

echo "[Customizing $i system]"
virt-customize -a $image --run-command 'yum remove cloud-init* -y'
virt-customize -a $image --root-password password:redhat
virt-customize -a $image --ssh-inject root:file:$WORKSPACE/vm_id_rsa.pub
virt-customize -a $image --hostname "$i"
echo "[$i done]"
echo "[Creating a ${VMROOTDISK} disk for root, ${IMAGE}]"
qemu-img create -f qcow2 "$BASEIMAGE" "$VMROOTDISK"
virt-resize --expand /dev/sda1 "$RHEL_IMAGE" "$BASEIMAGE"
qemu-img create -f qcow2 -b "$BASEIMAGE" "$IMAGE"

done
echo "[Creating a ${VMDOCKERDISK} disk for docker, ${DOCKERDISK}]"
qemu-img create -f raw "$DOCKERDISK" "$VMDOCKERDISK"

echo "[Creating a ${VMGLUSTERFSDISK} disk for glusterfs, ${GLUSTERFSDISK}]"
qemu-img create -f raw "$GLUSTERFSDISK" "$VMGLUSTERFSDISK"

exit
echo "[Customizing ${i} system]"
virt-customize -a "$IMAGE" --run-command 'yum remove cloud-init* -y'
virt-customize -a "$IMAGE" --root-password password:"$INITIALPASSWD"
virt-customize -a "$IMAGE" --ssh-inject root:file:"$CLUSTERKEY"
virt-customize -a "$IMAGE" --hostname "$i"
echo "[${i} done]"
done
103 changes: 75 additions & 28 deletions 1-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,89 @@

source ./env.sh

if [ ! -d $VMS ]
then
echo "Creating $VMS"
mkdir -p $VMS
# verify a bunch of variables have contents, as a sanity check
if [ ! -v VMS ]; then
echo "${VMS} is not defined. Please set this in env.sh and try again."
exit 1
fi
if [ ! -v CLUSTERKEY ]; then
echo "${CLUSTERKEY} is not defined. Please set this in env.sh and try again."
exit 2
fi
if [ ! -v ORIGINALKEY ]; then
echo "${ORIGINALKEY} is not defined. Please set this in env.sh and try again."
exit 3
fi
if [ ! -v VMROOTDISK ]; then
echo "${VMROOTDISK} is not defined. Please set this in env.sh and try again."
exit 4
fi
if [ ! -v INITIALPASSWD ]; then
echo "${INITIALPASSWD} is not defined. Please set this in env.sh and try again."
exit 5
fi

for i in `cat hosts|grep -v \\\\[`;
do
HOSTSFILE=hosts
if [ ! -r "$HOSTSFILE" ]; then
echo "${HOSTSFILE} is missing."
exit 10
fi

echo "########################################################################"
echo "[$i start]"
# create the VM directory if it doesn't exist
if [ ! -d "$VMS" ]; then
echo "Creating ${VMS}"
mkdir -p "$VMS"
fi

baseimage="$VMS/$i-base.qcow2"
image="$VMS/$i.qcow2"
dockerdisk="$VMS/$i-docker.qcow2"
glusterfsdisk="$VMS/$i-glusterfs.qcow2"
# sanity checks around the ssh key stuff
if [ ! -f "$CLUSTERKEY" ]; then # if the cluster sshkey doesn't exist, try to copy it from the original key
if [ ! -r "$ORIGINALKEY" ]; then # check to see if the original key exists and is readable
echo "${CLUSTERKEY} does not exist, and ${ORIGINALKEY} can't be found/read."
exit 6
fi

echo "[Creating a $VMROOTDISK disk for root, $image]"
qemu-img create -f qcow2 $baseimage $VMROOTDISK
virt-resize --expand /dev/sda1 $RHEL_IMAGE $baseimage
# if CLUSTERKEY doesn't exist, but the ORIGINALKEY does, copy it.
cp "$ORIGINALKEY" "$CLUSTERKEY"
COPYRESULT=$?
if [ "$COPYRESULT" -ne 0 ]; then
echo "Error: Copying ${ORIGINALKEY} to create ${CLUSTERKEY} failed with: ${COPYRESULT}"
exit 7
fi
fi
if [ ! -r "$CLUSTERKEY" ]; then # bomb out if the cluster sshkey isn't readable
echo "${CLUSTERKEY} is missing, or is not readbale. Exiting now."
exit 8
fi

qemu-img create -f qcow2 -b $baseimage $image
# ensure that the permissions are correct for the new cluster key
chmod 644 "$CLUSTERKEY"

echo "[Creating a $VMDOCKERDISK disk for docker, $dockerdisk]"
qemu-img create -f raw $dockerdisk $VMDOCKERDISK
# a safer, cleaner loop over the hosts file to read in lines, rather than words
grep -E '^[^\[ ]' < $HOSTSFILE | while IFS= read -r i
do
echo "########################################################################"
echo "[${i} start]"

echo "[Creating a $VMGLUSTERFSDISK disk for glusterfs, $glusterfsdisk]"
qemu-img create -f raw $glusterfsdisk $VMGLUSTERFSDISK
BASEIMAGE="${VMS}/${i}-base.qcow2"
IMAGE="${VMS}/${i}.qcow2"
DOCKERDISK="${VMS}/${i}-docker.qcow2"
GLUSTERFSDISK="${VMS}/${i}-glusterfs.qcow2"

echo "[Customizing $i system]"
virt-customize -a $image --run-command 'yum remove cloud-init* -y'
virt-customize -a $image --root-password password:redhat
virt-customize -a $image --ssh-inject root:file:$WORKSPACE/vm_id_rsa.pub
virt-customize -a $image --hostname "$i"
echo "[$i done]"
echo "[Creating a ${VMROOTDISK} disk for root, ${IMAGE}]"
qemu-img create -f qcow2 "$BASEIMAGE" "$VMROOTDISK"
virt-resize --expand /dev/sda1 "$RHEL_IMAGE" "$BASEIMAGE"
qemu-img create -f qcow2 -b "$BASEIMAGE" "$IMAGE"

done
echo "[Creating a ${VMDOCKERDISK} disk for docker, ${DOCKERDISK}]"
qemu-img create -f raw "$DOCKERDISK" "$VMDOCKERDISK"

echo "[Creating a ${VMGLUSTERFSDISK} disk for glusterfs, ${GLUSTERFSDISK}]"
qemu-img create -f raw "$GLUSTERFSDISK" "$VMGLUSTERFSDISK"

exit
echo "[Customizing ${i} system]"
virt-customize -a "$IMAGE" --run-command 'yum remove cloud-init* -y'
virt-customize -a "$IMAGE" --root-password password:"$INITIALPASSWD"
virt-customize -a "$IMAGE" --ssh-inject root:file:"$CLUSTERKEY"
virt-customize -a "$IMAGE" --hostname "$i"
echo "[${i} done]"
done
4 changes: 2 additions & 2 deletions 2-build-jump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ do
echo "[dry-run install $i w/ mac ${MACADDRESS[$i]}"

virt-install --ram $VMRAM_JUMP --vcpus 4 --os-variant rhel7 --disk path=$image,device=disk,bus=virtio,format=qcow2 \
--noautoconsole --vnc --name $i --dry-run --cpu Skylake-Client,+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \
--noautoconsole --vnc --name $i --dry-run --cpu ${CPUMODEL},+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \
--print-xml > $VMS/$i.xml
# You may also need to change the CPU depending on the hypervisor's CPU
# --noautoconsole --vnc --name $i --dry-run --cpu Skylake-Client,+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \
# --noautoconsole --vnc --name $i --dry-run --cpu ${CPUMODEL},+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \

echo "[define $i]"
virsh define --file $VMS/$i.xml
Expand Down
4 changes: 2 additions & 2 deletions 2-build-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ do
echo "[dry-run install $i w/ mac ${MACADDRESS[$i]}"

virt-install --ram $VMRAM_OCP --vcpus 4 --os-variant rhel7 --disk path=$image,device=disk,bus=virtio,format=qcow2 \
--noautoconsole --vnc --name $i --dry-run --cpu Skylake-Client,+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \
--noautoconsole --vnc --name $i --dry-run --cpu ${CPUMODEL},+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \
--print-xml > $VMS/$i.xml
# You may also need to change the CPU depending on the hypervisor's CPU
# --noautoconsole --vnc --name $i --dry-run --cpu Skylake-Client,+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \
# --noautoconsole --vnc --name $i --dry-run --cpu ${CPUMODEL},+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \

echo "[define $i]"
virsh define --file $VMS/$i.xml
Expand Down
4 changes: 2 additions & 2 deletions 2-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ do
echo "[dry-run install $i w/ mac ${MACADDRESS[$i]}"

virt-install --ram $VMRAM_OCP --vcpus 4 --os-variant rhel7 --disk path=$image,device=disk,bus=virtio,format=qcow2 \
--noautoconsole --vnc --name $i --dry-run --cpu Skylake-Client,+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \
--noautoconsole --vnc --name $i --dry-run --cpu ${CPUMODEL},+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \
--print-xml > $VMS/$i.xml
# You may also need to change the CPU depending on the hypervisor's CPU
# --noautoconsole --vnc --name $i --dry-run --cpu Skylake-Client,+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \
# --noautoconsole --vnc --name $i --dry-run --cpu ${CPUMODEL},+vmx --network bridge=${BRIDGE},mac=${MACADDRESS[$i]} \

echo "[define $i]"
virsh define --file $VMS/$i.xml
Expand Down
Loading