While upgrading the openstack platform we upgrade one service at a time. This article gives an overview of how to test core-functionality for each service.
Keystone
To verify the operation of keystone the following openstack-commands can be used:
List all openstack projects
openstack project list
- List openstack-groups groups from LDAP.
openstack group list --domain NTNU
- List API-URL's for the other services
openstack catalog list
Glance
Testing glance can be done quick and easy, by seeing that it can list images:
openstack image list
It can also be tested a bit more thouroughly by uploading an image:
wget https://cloud-images.ubuntu.com/kinetic/current/kinetic-server-cloudimg-amd64.img
qemu-img convert -f qcow2 kinetic-server-cloudimg-amd64.img -O raw kinetic-server-cloudimg-amd64.raw
openstack image create --disk-format raw --min-disk 3 --file kinetic-server-cloudimg-amd64.raw --private "Ubuntu Server 22.10 (Kinetic Kudu) amd64 - testing"
Cinder
Testing cinder is quick and easy, by listing all volumes:
openstack volume list
It can also be tested a bit more thoroughly, by creating a new volume, and attach it to an instance
openstack volume create --type SSD-300 --size 1 testvolum
openstack server add volume <server> testvolum
Neutron
API-nodes
- openstack network list
- openstack router list
- admintools/testing/neutron.bash create
- admintools/testing/neutron.bash delete
BGP-agents
- watch ./sjekkBGP.sh
Network-nodes
# Get ID's of the neutronnet nodes openstack network agent list --agent-type l3 # List routers on a neutronnet node openstack router list --agent <ID from previous command> # Get ip from a router openstack router show <id of router found from previous command> ping <ip> # Move a router cd admintools/networking ./migrate-router.sh <id of router> <neutronet node> # Move all routers from a neutronnet node. It will cause a bit downtime on the network if it's many routers. ./migrate-routers.sh <source neutronnet node> <destination neutronnet node>
Placement
The placement API is just a simple API, and it only needs simple tests like:
openstack resource provider list
openstack trait list
Nova
Nova API
Test by listing servers
openstack server list --all-projects
Nova-services
- Verify that all services are up
openstack compute service list
- Test by creating a new VM. Verify that this completes successfully
- Check that the VNC console in horizon still works
Heat
Simple verification is done by checking that the API responds:
openstack stack list
The more thourough approach is to have heat create a heat-stack. This can for instance be done with the following command (using template.yaml from admintools/heatexample):
openstack stack create -t template.yaml --parameter key_name=Galao \
--parameter image=c15481d3-e1ac-4331-9379-c63cb14d12b1 --parameter flavor=gx2.2c4r \
--parameter public_net=ntnu-internal --parameter sec_group=SSH-NTNU-IPv4 TEST
Barbican
List all secrets in your current project. This will most probably return an empty reponse..
openstack secret list
Store a test secret
openstack secret store --name testhemmelighet --secret-type passphrase --payload-content-type "text/plain" --payload "hemmelig tekst"
Magnum
List all clusters and cluster templates
openstack coe cluster list
openstack coe cluster template list
Create a cluster, and verify that it is created successfully
- Create a single-master cluster with the newest template
openstack coe cluster create testcluster --cluster-template kubernetes-v1.xx.xx --master-count 1 --node-count 1 --keypair <your keypair>
- Create a multi-master cluster with the newest tamplate
openstack coe cluster create ha-testcluster --cluster-template kubernetes-v1.xx.xx-ha --master-count 3 --node-count 1 --keypair <your keypair>
Verifiy that the cluster creation is finished with the CREATE_COMPLETE status, and that they are reported as HEALTHY
openstack cluster list
Extra step: verify with kubectl that everything works fine:
mkdir -p ~/clusters/testcluster
$(openstack coe cluster config testcluster --dir ~/clusters/testcluster)
kubectl get nodes
kubectl -n kube-system get pods
The kubectl commands should list all nodes and pods of your cluster
Octavia
-
Horizon
Browse around, and verify that everything behaves the way you expect..