Skip to content

Commit

Permalink
Merge pull request #553 from steveb/edpm_bm_remove
Browse files Browse the repository at this point in the history
Delete devsetup gen-edpm-baremetal-kustomize.sh
openshift-ci[bot] authored Oct 4, 2023
2 parents 3dfba67 + c23e3a4 commit c1c1cfd
Showing 4 changed files with 68 additions and 181 deletions.
58 changes: 22 additions & 36 deletions devsetup/Makefile
Original file line number Diff line number Diff line change
@@ -29,19 +29,10 @@ BMAAS_REDFISH_PASSWORD ?= password
BMAAS_SUSHY_EMULATOR_NAMESPACE ?= sushy-emulator
BMAAS_LIBVIRT_USER ?= sushyemu

DATAPLANE_REGISTRY_URL ?= quay.io/podified-antelope-centos9
DATAPLANE_CONTAINER_TAG ?= current-podified
DATAPLANE_PLAYBOOK ?= osp.edpm.download_cache
DATAPLANE_CHRONY_NTP_SERVER ?=pool.ntp.org
DATAPLANE_SSHD_ALLOWED_RANGES ?=['192.168.122.0/24']
DATAPLANE_CUSTOM_SERVICE_RUNNER_IMG ?=quay.io/openstack-k8s-operators/openstack-ansibleee-runner:latest
DATAPLANE_ANSIBLE_USER ?=cloud-admin
DATAPLANE_ANSIBLE_SECRET ?=dataplane-ansible-ssh-private-key-secret
DATAPLANE_GROWVOLS_ARGS ?=/=8GB /tmp=1GB /home=1GB /var=8GB
BM_PROVISIONING_INTERFACE ?=enp6s0
BM_CTLPLANE_INTERFACE ?=enp1s0
DATAPLANE_GROWVOLS_ARGS ?=
BM_NETWORK_NAME ?=default
BM_NETWORK_IPADDRESS ?=192.168.122.1
BM_INSTANCE_NAME_PREFIX ?=edpm-compute
BM_NODE_COUNT ?=1
BM_ROOT_PASSWORD_SECRET ?=
@@ -108,38 +99,33 @@ crc_attach_default_interface_cleanup: ## Detach default libvirt network from CRC
##@ EDPM

.PHONY: edpm_baremetal
edpm_baremetal: export EDPM_BMH_NAMESPACE=${BMH_NAMESPACE}
edpm_baremetal: export EDPM_PROVISIONING_INTERFACE=${BM_PROVISIONING_INTERFACE}
edpm_baremetal: export EDPM_CTLPLANE_INTERFACE=${BM_CTLPLANE_INTERFACE}
edpm_baremetal: export OPERATOR_NAME=openstack
edpm_baremetal: export EDPM_ANSIBLE_SECRET=${DATAPLANE_ANSIBLE_SECRET}
edpm_baremetal: export EDPM_ANSIBLE_USER=${DATAPLANE_ANSIBLE_USER}
edpm_baremetal: export BMAAS_NETWORK_NAME=${BM_NETWORK_NAME}
edpm_baremetal: export BMAAS_NETWORK_IPADDRESS=${BM_NETWORK_IPADDRESS}
edpm_baremetal: export BMAAS_INSTANCE_NAME_PREFIX=${BM_INSTANCE_NAME_PREFIX}
edpm_baremetal: export EDPM_CHRONY_NTP_SERVER=${DATAPLANE_CHRONY_NTP_SERVER}
edpm_baremetal: export EDPM_SSHD_ALLOWED_RANGES=${DATAPLANE_SSHD_ALLOWED_RANGES}
edpm_baremetal: export EDPM_ROOT_PASSWORD_SECRET=${BM_ROOT_PASSWORD_SECRET}
edpm_baremetal: export BMAAS_NODE_COUNT=${BM_NODE_COUNT}
edpm_baremetal: export NODE_COUNT=${BM_NODE_COUNT}
edpm_baremetal: export EDPM_TOTAL_NODES=${BM_NODE_COUNT}
edpm_baremetal: export OPENSTACK_RUNNER_IMG=${DATAPLANE_CUSTOM_SERVICE_RUNNER_IMG}
edpm_baremetal: export EDPM_REGISTRY_URL=${DATAPLANE_REGISTRY_URL}
edpm_baremetal: export EDPM_CONTAINER_TAG=${DATAPLANE_CONTAINER_TAG}
edpm_baremetal: export DATAPLANE_TOTAL_NODES=${BM_NODE_COUNT}
edpm_baremetal: export EDPM_GROWVOLS_ARGS=${DATAPLANE_GROWVOLS_ARGS}
edpm_baremetal: ## Deploy only dataplane with BMAAS
edpm_baremetal: edpm_baremetal_compute
make -C .. edpm_deploy_baremetal

.PHONY: edpm_baremetal_compute
edpm_baremetal_compute: export OPERATOR_NAME=openstack
edpm_baremetal_compute: export BMAAS_NETWORK_NAME=${BM_NETWORK_NAME}
edpm_baremetal_compute: export BMAAS_INSTANCE_NAME_PREFIX=${BM_INSTANCE_NAME_PREFIX}
edpm_baremetal_compute: export BMAAS_NODE_COUNT=${BM_NODE_COUNT}
edpm_baremetal_compute: export NODE_COUNT=${BM_NODE_COUNT}
edpm_baremetal_compute: export DEPLOY_DIR=../out/bmaas
edpm_baremetal_compute: ## Create virtual baremetal for the dataplane
$(eval $(call vars))
make bmaas_virtual_bms
make bmaas_sushy_emulator
scripts/gen-ansibleee-ssh-key.sh
scripts/edpm-compute-baremetal.sh --create
bash scripts/edpm-compute-baremetal.sh --create

.PHONY: edpm_baremetal_cleanup
edpm_baremetal_cleanup: export BMAAS_NETWORK_NAME=${BM_NETWORK_NAME}
edpm_baremetal_cleanup: export BMAAS_INSTANCE_NAME_PREFIX=${BM_INSTANCE_NAME_PREFIX}
edpm_baremetal_cleanup: export BMAAS_NODE_COUNT=${BM_NODE_COUNT}
edpm_baremetal_cleanup: export NODE_COUNT=${BM_NODE_COUNT}
edpm_baremetal_cleanup: ## Cleanup dataplane with BMAAS
edpm_baremetal_cleanup: edpm_baremetal_compute_cleanup
make -C .. edpm_deploy_cleanup

edpm_baremetal_compute_cleanup: export BMAAS_NETWORK_NAME=${BM_NETWORK_NAME}
edpm_baremetal_compute_cleanup: export BMAAS_INSTANCE_NAME_PREFIX=${BM_INSTANCE_NAME_PREFIX}
edpm_baremetal_compute_cleanup: export BMAAS_NODE_COUNT=${BM_NODE_COUNT}
edpm_baremetal_compute_cleanup: export NODE_COUNT=${BM_NODE_COUNT}
edpm_baremetal_compute_cleanup: ## Cleanup dataplane with BMAAS
$(eval $(call vars))
scripts/edpm-compute-baremetal.sh --cleanup
pushd .. && rm -Rf out/edpm || true && popd
34 changes: 34 additions & 0 deletions devsetup/README.md
Original file line number Diff line number Diff line change
@@ -131,6 +131,40 @@ In case additional compute node VMs are deployed, run:
make edpm_compute_cleanup EDPM_COMPUTE_SUFFIX=1
```

### EDPM virtual baremetal deployment

The EDPM virtual machines can be managed by the openstack-baremetal-operator and
metal3, which interact with a virtual Redfish BMC provided by sushy-tools.

This requires a running baremetal-operator, and dataplane-operator:
```
pushd ..
make openstack
popd
```

Create and manage the virtual machines:
```
BM_NODE_COUNT=1 make edpm_baremetal_compute
```

The dataplane can then be deployed on these nodes as for other baremetal
dataplane deployments:
```
pushd ..
DATAPLANE_TOTAL_NODES=1 make edpm_deploy_baremetal
popd
```

Cleanup:
```
pushd ..
make edpm_deploy_cleanup
popd
# Will delete VM's!:
BM_NODE_COUNT=1 make edpm_baremetal_compute_cleanup
```

### BMaaS LAB
The BMaaS LAB will create additional VM's alongside the CRC instance as well
as a virtual RedFish (sushy-emulator) service running in CRC. The VMs can be
18 changes: 12 additions & 6 deletions devsetup/scripts/edpm-compute-baremetal.sh
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ BMH_CR_FILE=${BMH_CR_FILE:-bmh_deploy.yaml}

function create {
mkdir -p ${DEPLOY_DIR}
pushd ${DEPLOY_DIR}
NODE_INDEX=0
while IFS= read -r instance; do
export uuid_${NODE_INDEX}="${instance% *}"
@@ -43,11 +44,11 @@ function create {
NODE_INDEX=$((NODE_INDEX+1))
done <<< "$(virsh --connect=qemu:///system list --all --uuid --name | grep "${NODE_NAME_PREFIX}")"

rm ${DEPLOY_DIR}/${BMH_CR_FILE} || true
rm ${BMH_CR_FILE} || true
for (( i=0; i<${NODE_COUNT}; i++ )); do
mac_var=mac_address_${i}
uuid_var=uuid_${i}
cat <<EOF >>${DEPLOY_DIR}/${BMH_CR_FILE}
cat <<EOF >>${BMH_CR_FILE}
---
# This is the secret with the BMC credentials (Redfish in this case).
apiVersion: v1
@@ -78,14 +79,19 @@ spec:
deviceName: /dev/vda
EOF
done
/bin/bash ${SCRIPTPATH}/gen-edpm-baremetal-kustomize.sh
cat <<EOF >kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: ${NAMESPACE}
resources:
- ${BMH_CR_FILE}
EOF
popd
/bin/bash ../scripts/operator-deploy-resources.sh
}

function cleanup {
oc delete --all openstackdataplanenodeset --ignore-not-found=true || true
oc delete --all openstackdataplaneservice --ignore-not-found=true || true
oc delete --all openstackdataplanedeployment --ignore-not-found=true || true
while oc get bmh | grep -q -e "deprovisioning" -e "provisioned"; do
sleep 5
done || true
139 changes: 0 additions & 139 deletions devsetup/scripts/gen-edpm-baremetal-kustomize.sh

This file was deleted.

0 comments on commit c1c1cfd

Please sign in to comment.