File: oci-poc-setup

package info (click to toggle)
openstack-cluster-installer 43.0.22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,544 kB
  • sloc: php: 19,169; sh: 18,137; ruby: 75; makefile: 31; xml: 8
file content (76 lines) | stat: -rwxr-xr-x 2,030 bytes parent folder | download
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
#!/bin/sh

set -e
set -x

if ! [ -r /etc/oci-poc/oci-poc.conf ] ; then
	echo "Cannot read /etc/oci-poc/oci-poc.conf"
fi
. /etc/oci-poc/oci-poc.conf

MYDIR=$(pwd)
cd /var/lib/openstack-cluster-installer-poc/templates

if [ -r /root/.ssh/authorized_keys ] ; then
	ROOT_SSH_KEY_PARAM="--root-ssh-key /root/.ssh/authorized_keys"
else
	echo "Could not read /root/.ssh/authorized_keys, please make one."
	exit 1
fi

ADDR_PARAM="addr=${OCI_VM_IP}/24:${HOST_NETWORK_PREFIX}.1"
if [ "${USE_IKVSWITCH}" = "yes" ] ; then
	IFACE_DEF="--static-iface type=bgp,vlannum=${BGP_TO_HOST_VLAN},iface0=ens4,iface1=ens5,${ADDR_PARAM},asnum=${GUEST_VM_AS_NUM}"
else
	IFACE_DEF="--static-iface type=normal,iface0=ens4,${ADDR_PARAM}"
fi

if [ "${debian_release}" = "buster" ] || [ "${debian_release}" = "bullseye" ] ; then
	FSOPT="--bullseye-compat-fs"
else
	FSOPT=""
fi

# Build a full Debian OS with our ssh key in it
build-openstack-debian-image \
	--release ${debian_release} \
	--output pxe-server-node \
	--boot-manager grub \
	--debootstrap-url ${DEBIAN_MIRROR} \
	--sources.list-mirror ${DEBIAN_MIRROR} \
	--image-size 40 \
	--extra-packages gnupg2,joe \
	--password ${OCI_VM_ROOT_PASS} \
	--no-cloud-init \
	${ROOT_SSH_KEY_PARAM} \
	--no-remove-host-keys \
	--permit-ssh-as-root \
	--hostname ${OCI_VM_FQDN} \
	${IFACE_DEF} \
	--security-mirror ${DEBIAN_SECURITY_MIRROR} \
	--hook-script /usr/bin/oci-poc-setup-bodi-hook \
	--no-cloud-kernel \
	--newer-qemu ${FSOPT}

# Create an empty 10GB HDD
qemu-img create slave-image.raw 60G
qemu-img convert -c -f raw slave-image.raw -o compat=0.10 -O qcow2 slave-image.qcow2
rm slave-image.raw

cd ${MYDIR}

set +x

echo "Provision of the OCI PoC images is done."
echo "Please restart the VMs with:"
echo "  oci-poc-vms stop"
echo "  oci-poc-vms start"
echo ""
echo "Then you can automatically provision a cluster:"
echo " oci-poc-install-cluster-bgp"
echo ""
echo "Then you can install it:"
echo " ocicli cluster-install cl1"
echo ""
echo "Thanks for running oci-poc and contributing to OCI! :)"
echo ""