From 82e83fb799020edd709106f053ecdf92fe619c1e Mon Sep 17 00:00:00 2001 From: Bohdan Dobrelia Date: Thu, 8 Feb 2024 13:53:56 +0100 Subject: [PATCH] Ceph: workloads adoption with cinder volume Signed-off-by: Bohdan Dobrelia --- .../assemblies/development_environment.adoc | 3 ++- .../files/pre_launch.bash | 18 ++------------ .../development_environment/tasks/main.yaml | 24 +++++++++++++++++++ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/docs_dev/assemblies/development_environment.adoc b/docs_dev/assemblies/development_environment.adoc index 6fd4e605a..4ad8a9623 100644 --- a/docs_dev/assemblies/development_environment.adoc +++ b/docs_dev/assemblies/development_environment.adoc @@ -286,7 +286,8 @@ Confirm the image UUID can be seen in Ceph's images pool. [,bash] ---- -ssh -i ~/install_yamls/out/edpm/ansibleee-ssh-key-id_rsa root@192.168.122.100 sudo cephadm shell -- rbd -p images ls -l +CONTROLLER1_SSH="ssh -i ~/install_yamls/out/edpm/ansibleee-ssh-key-id_rsa root@192.168.122.100" +$CONTROLLER1_SSH sudo cephadm shell -- rbd -p images ls -l ---- Create a Cinder volume, a backup from it, and snapshot it. diff --git a/tests/roles/development_environment/files/pre_launch.bash b/tests/roles/development_environment/files/pre_launch.bash index 74674c229..6e257f644 100644 --- a/tests/roles/development_environment/files/pre_launch.bash +++ b/tests/roles/development_environment/files/pre_launch.bash @@ -47,20 +47,6 @@ ${BASH_ALIASES[openstack]} security group rule list --protocol tcp --ingress -f ${BASH_ALIASES[openstack]} security group rule create --protocol tcp --ingress --dst-port 22 $(${BASH_ALIASES[openstack]} security group list --project admin -f value -c ID) # check connectivity via FIP +export FIP=192.168.122.20 # FIXME: defer __network_adoption__ - this doesn't work yet in the adoption procedure -#ping -c4 192.168.122.20 - -# FIXME: Invalid volume: Volume xxx status must be available, but current status is: backing-up -# Create a Cinder volume, a backup from it, and snapshot it. -#${BASH_ALIASES[openstack]} volume show disk || \ -# ${BASH_ALIASES[openstack]} volume create --image cirros --bootable --size 1 disk -#${BASH_ALIASES[openstack]} volume backup show backup || \ -# ${BASH_ALIASES[openstack]} volume backup create --name backup disk -#${BASH_ALIASES[openstack]} volume snapshot show snapshot || \ -# ${BASH_ALIASES[openstack]} volume snapshot create --volume disk snapshot - -# TODO: Add volume to the test VM, after tripleo wallaby (osp 17) isolnet network adoption implemented for storage networks -#${BASH_ALIASES[openstack]} volume show disk -f json | jq -r '.status' | grep -q available && \ -# ${BASH_ALIASES[openstack]} server add volume test disk - -export FIP=192.168.122.20 \ No newline at end of file +#ping -c4 $FIP \ No newline at end of file diff --git a/tests/roles/development_environment/tasks/main.yaml b/tests/roles/development_environment/tasks/main.yaml index eb2287689..a7949bde0 100644 --- a/tests/roles/development_environment/tasks/main.yaml +++ b/tests/roles/development_environment/tasks/main.yaml @@ -3,5 +3,29 @@ when: prelaunch_test_instance|bool ansible.builtin.shell: cmd: | + {{ shell_header }} alias openstack="ssh -i {{ edpm_privatekey_path }} root@{{ edpm_node_ip }} OS_CLOUD=standalone openstack" {{ lookup('ansible.builtin.file', 'pre_launch.bash') }} + + # Ceph Storage Steps + # FIXME(bogdando): fix race for volume status must be available, instead of backing-up, before snapshotting it + # TODO(bogdando): test volume attach after isolnet network adoption implemented for storage networks + + # Confirm the image UUID can be seen in Ceph's images pool + CONTROLLER1_SSH="{{ controller1_ssh }}" + $CONTROLLER1_SSH sudo cephadm shell -- rbd -p images ls -l + + # Create a Cinder volume, a backup from it, and snapshot it + ${BASH_ALIASES[openstack]} volume show disk ||\ + ${BASH_ALIASES[openstack]} volume create --image cirros --bootable --size 1 disk + + ${BASH_ALIASES[openstack]} volume backup show backup ||\ + ${BASH_ALIASES[openstack]} volume backup create --name backup disk + + ${BASH_ALIASES[openstack]} volume snapshot show snapshot ||\ + ${BASH_ALIASES[openstack]} volume snapshot create --volume disk snapshot + + # Add volume to the test VM + ${BASH_ALIASES[openstack]} volume show disk -f json | jq -r '.status' | grep -q available && \ + ${BASH_ALIASES[openstack]} server add volume test disk +