Skip to content

Commit

Permalink
docs: update vmware.sh
Browse files Browse the repository at this point in the history
Add support for using the GOVC_NETWORK environment variable to determine which vSphere vSwitch PortGroup to use.

This checks if the GOVC_NETWORK environment variable is set, if that's the case, use that value. If not, continue with the default PortGroup (VM Network) as before.

Checks added for both control plane and worker nodes.

Signed-off-by: Christian Mohn <christian@drible.net>
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
h0bbel authored and smira committed Jan 29, 2024
1 parent d1a79b8 commit 385707c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set -e
# export GOVC_INSECURE=true
# export GOVC_URL='https://172.16.199.151'
# export GOVC_DATASTORE='xxx'
# export GOVC_NETWORK='PortGroup Name'

CLUSTER_NAME=${CLUSTER_NAME:=vmware-test}
TALOS_VERSION=v1.1.0
Expand Down Expand Up @@ -55,6 +56,13 @@ create () {

govc vm.disk.change -vm ${CLUSTER_NAME}-control-plane-${i} -disk.name disk-1000-0 -size ${CONTROL_PLANE_DISK}

if [ -z "${GOVC_NETWORK+x}" ]; then
echo "GOVC_NETWORK is unset, assuming default VM Network";
else
echo "GOVC_NETWORK set to ${GOVC_NETWORK}";
govc vm.network.change -vm ${CLUSTER_NAME}-control-plane-${i} -net ${GOVC_NETWORK} ethernet-0
fi

govc vm.power -on ${CLUSTER_NAME}-control-plane-${i}
done

Expand All @@ -75,6 +83,14 @@ create () {

govc vm.disk.change -vm ${CLUSTER_NAME}-worker-${i} -disk.name disk-1000-0 -size ${WORKER_DISK}

if [ -z "${GOVC_NETWORK+x}" ]; then
echo "GOVC_NETWORK is unset, assuming default VM Network";
else
echo "GOVC_NETWORK set to ${GOVC_NETWORK}";
govc vm.network.change -vm ${CLUSTER_NAME}-worker-${i} -net ${GOVC_NETWORK} ethernet-0
fi


govc vm.power -on ${CLUSTER_NAME}-worker-${i}
done

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set -e
# export GOVC_INSECURE=true
# export GOVC_URL='https://172.16.199.151'
# export GOVC_DATASTORE='xxx'
# export GOVC_NETWORK='PortGroup Name'

CLUSTER_NAME=${CLUSTER_NAME:=vmware-test}
TALOS_VERSION=v1.1.0
Expand Down Expand Up @@ -55,6 +56,13 @@ create () {

govc vm.disk.change -vm ${CLUSTER_NAME}-control-plane-${i} -disk.name disk-1000-0 -size ${CONTROL_PLANE_DISK}

if [ -z "${GOVC_NETWORK+x}" ]; then
echo "GOVC_NETWORK is unset, assuming default VM Network";
else
echo "GOVC_NETWORK set to ${GOVC_NETWORK}";
govc vm.network.change -vm ${CLUSTER_NAME}-control-plane-${i} -net ${GOVC_NETWORK} ethernet-0
fi

govc vm.power -on ${CLUSTER_NAME}-control-plane-${i}
done

Expand All @@ -75,6 +83,14 @@ create () {

govc vm.disk.change -vm ${CLUSTER_NAME}-worker-${i} -disk.name disk-1000-0 -size ${WORKER_DISK}

if [ -z "${GOVC_NETWORK+x}" ]; then
echo "GOVC_NETWORK is unset, assuming default VM Network";
else
echo "GOVC_NETWORK set to ${GOVC_NETWORK}";
govc vm.network.change -vm ${CLUSTER_NAME}-worker-${i} -net ${GOVC_NETWORK} ethernet-0
fi


govc vm.power -on ${CLUSTER_NAME}-worker-${i}
done

Expand Down

0 comments on commit 385707c

Please sign in to comment.