Action rename-volume-host fails if backend to be renamed does not exist

Bug #1956470 reported by Giuseppe Petralia
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Cinder Charm
Fix Committed
Undecided
dongdong tao

Bug Description

In a Cloud upgraded from trusty/mitaka to xenial/queens with stepped upgrades and finally to bionic/queens, there are some older volumes that have wrong host attribute equal to cinder@cinder-ceph#cinder.volume.drivers.rbd.RBDDriver.

When trying to create a snapshot of that volumes or creating a new volume from a snapshot, this fails with:

2022-01-04 12:35:40.750 69884 ERROR cinder.scheduler.manager [req-4f20b00c-37a8-4e2d-b689-a92c75d2dabc 4cc22e877fad4ff580abd78567acab2c 500cec76ab6c49c198a4fe0138ba7dc6 - b71e87f93ff54f4c9c66a8db1a2cab5f b71e87f93ff54f4c9c66a8db1a2cab5f] Failed to schedule_create_snapshot: Cannot place snapshot e157421c-3455-47c9-8dd8-933111309d94 on cinder@cinder-ceph#cinder.volume.drivers.rbd.RBDDriver.: NoValidBackend: Cannot place snapshot e157421c-3455-47c9-8dd8-933111309d94 on cinder@cinder-ceph#cinder.volume.drivers.rbd.RBDDriver.

If I update manually the host on the DB to cinder@cinder-ceph#cinder-ceph everything works fine.

To fix that I tried to use the rename-volume-host action:

$ juju run-action cinder/7 rename-volume-host currenthost='cinder@cinder-ceph#cinder.volume.drivers.rbd.RBDDriver' newhost='cinder@cinder-ceph#cinder-ceph' --wait
unit-cinder-7:
  UnitId: cinder/7
  id: "11352"
  message: Cannot update host attribute from cinder@cinder-ceph#cinder.volume.drivers.rbd.RBDDriver,
    cinder@cinder-ceph#cinder.volume.drivers.rbd.RBDDriver not found
  results: {}
  status: failed
  timing:
    completed: 2022-01-05 12:34:59 +0000 UTC
    enqueued: 2022-01-05 12:34:56 +0000 UTC
    started: 2022-01-05 12:34:56 +0000 UTC

This is happening because the charm checks if currenthost exists in hosts from "cinder-manage service list":

# cinder-manage service list
Binary Host Zone Status State Updated At RPC Version Object Version Cluster
cinder-scheduler cinder nova enabled :-) 2022-01-05 12:41:50 3.10 1.35
cinder-backup cinder nova enabled :-) 2022-01-05 12:41:49 2.1 1.35
cinder-volume cinder-ssd@ssd-storage nova enabled :-) 2022-01-05 12:41:41 3.15 1.35
cinder-volume cinder@cinder-ceph nova enabled :-) 2022-01-05 12:41:48 3.15 1.35

and the host is not there but actually from documentation [0] I understand that action is intended to fix that kind of issues when a backend is removed or renamed but that fails and then charm should not check if currenthost is there or not. Also currenthost is passed in the format:

 host_uuid@backend-name#pool [1]

And can not be == to host in cinder-manage service list where you have only host_uuid@backend-name. That makes the action unusable.

0. https://github.com/openstack/cinder/blob/master/cinder/cmd/manage.py#L573

1. https://support.platform9.com/hc/en-us/articles/360010968913-Changing-Management-of-Volumes-in-a-Shared-Storage-Backend

summary: - Action rename-volume-host fails if backend to be replace does not exist
+ Action rename-volume-host fails if backend to be replaced does not exist
summary: - Action rename-volume-host fails if backend to be replaced does not exist
+ Action rename-volume-host fails if backend to be renamed does not exist
description: updated
Revision history for this message
Giuseppe Petralia (peppepetra) wrote :

Another question will be given that I have the following available pools:

$ cinder get-pools
+----------+--------------------------------+
| Property | Value |
+----------+--------------------------------+
| name | cinder@cinder-ceph#cinder-ceph |
+----------+--------------------------------+
+----------+------------------------------------+
| Property | Value |
+----------+------------------------------------+
| name | cinder-ssd@ssd-storage#ssd-storage |
+----------+------------------------------------+

can I workaround the snapshot creation issue using a query directly on the DB like the following?

update volumes set host="cinder@cinder-ceph#cinder-ceph" where host="cinder@cinder-ceph#cinder.volume.drivers.rbd.RBDDriver";

dongdong tao (taodd)
tags: added: sts
dongdong tao (taodd)
Changed in charm-cinder:
assignee: nobody → dongdong tao (taodd)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-cinder (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-cinder (master)

Reviewed: https://review.opendev.org/c/openstack/charm-cinder/+/837698
Committed: https://opendev.org/openstack/charm-cinder/commit/93dfc624d4325630dcbd3ba9d06c5f8d3f38845c
Submitter: "Zuul (22348)"
Branch: master

commit 93dfc624d4325630dcbd3ba9d06c5f8d3f38845c
Author: dongdong tao <email address hidden>
Date: Mon Mar 28 11:50:41 2022 +0800

    Check if the newhost exists instead of currenthost

    Closes-Bug: #1956470

    Signed-off-by: Dongdong Tao <email address hidden>
    Change-Id: I2b9eec030a5b0f6d9a405cecea29bef04eb72f5d

Changed in charm-cinder:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-cinder (stable/21.10)

Fix proposed to branch: stable/21.10
Review: https://review.opendev.org/c/openstack/charm-cinder/+/866511

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-cinder (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/charm-cinder/+/866512

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-cinder (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/charm-cinder/+/866513

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-cinder (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/charm-cinder/+/866514

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-cinder (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/charm-cinder/+/866515

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-cinder (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/charm-cinder/+/866516

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-cinder (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/charm-cinder/+/866517

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-cinder (stable/21.10)

Change abandoned by "Alex Kavanagh <email address hidden>" on branch: stable/21.10
Review: https://review.opendev.org/c/openstack/charm-cinder/+/866511
Reason: stable/21.10 is end-of-life and not taking any patches; i.e. there's no way to rebuild the charm from this branch and publish. The patches to the other branches are fine though. Thanks.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-cinder (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/charm-cinder/+/866512
Committed: https://opendev.org/openstack/charm-cinder/commit/c3dd781828688cb326c484b6a7be4b6f21241e9e
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit c3dd781828688cb326c484b6a7be4b6f21241e9e
Author: dongdong tao <email address hidden>
Date: Mon Mar 28 11:50:41 2022 +0800

    Check if the newhost exists instead of currenthost

    Closes-Bug: #1956470

    Signed-off-by: Dongdong Tao <email address hidden>
    Change-Id: I2b9eec030a5b0f6d9a405cecea29bef04eb72f5d
    (cherry picked from commit 93dfc624d4325630dcbd3ba9d06c5f8d3f38845c)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-cinder (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/charm-cinder/+/866513
Committed: https://opendev.org/openstack/charm-cinder/commit/f62e7554dc0054f61caed55cf7603c5afe97b27f
Submitter: "Zuul (22348)"
Branch: stable/xena

commit f62e7554dc0054f61caed55cf7603c5afe97b27f
Author: dongdong tao <email address hidden>
Date: Mon Mar 28 11:50:41 2022 +0800

    Check if the newhost exists instead of currenthost

    Closes-Bug: #1956470

    Signed-off-by: Dongdong Tao <email address hidden>
    Change-Id: I2b9eec030a5b0f6d9a405cecea29bef04eb72f5d
    (cherry picked from commit 93dfc624d4325630dcbd3ba9d06c5f8d3f38845c)

tags: added: in-stable-xena
tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-cinder (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/charm-cinder/+/866514
Committed: https://opendev.org/openstack/charm-cinder/commit/0a0cbaeee746fd130d4064dbcfe0aa83b499e352
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 0a0cbaeee746fd130d4064dbcfe0aa83b499e352
Author: dongdong tao <email address hidden>
Date: Mon Mar 28 11:50:41 2022 +0800

    Check if the newhost exists instead of currenthost

    Closes-Bug: #1956470

    Signed-off-by: Dongdong Tao <email address hidden>
    Change-Id: I2b9eec030a5b0f6d9a405cecea29bef04eb72f5d
    (cherry picked from commit 93dfc624d4325630dcbd3ba9d06c5f8d3f38845c)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-cinder (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/charm-cinder/+/866515
Committed: https://opendev.org/openstack/charm-cinder/commit/f315a9c24ba381400917c75a7a0ebfb6a7786af1
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit f315a9c24ba381400917c75a7a0ebfb6a7786af1
Author: dongdong tao <email address hidden>
Date: Mon Mar 28 11:50:41 2022 +0800

    Check if the newhost exists instead of currenthost

    Closes-Bug: #1956470

    Signed-off-by: Dongdong Tao <email address hidden>
    Change-Id: I2b9eec030a5b0f6d9a405cecea29bef04eb72f5d
    (cherry picked from commit 93dfc624d4325630dcbd3ba9d06c5f8d3f38845c)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-cinder (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/charm-cinder/+/866516
Committed: https://opendev.org/openstack/charm-cinder/commit/be4f8050f9a68d881f41b68361bec0c90f28451f
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit be4f8050f9a68d881f41b68361bec0c90f28451f
Author: dongdong tao <email address hidden>
Date: Mon Mar 28 11:50:41 2022 +0800

    Check if the newhost exists instead of currenthost

    Closes-Bug: #1956470

    Signed-off-by: Dongdong Tao <email address hidden>
    Change-Id: I2b9eec030a5b0f6d9a405cecea29bef04eb72f5d
    (cherry picked from commit 93dfc624d4325630dcbd3ba9d06c5f8d3f38845c)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-cinder (stable/train)

Reviewed: https://review.opendev.org/c/openstack/charm-cinder/+/866517
Committed: https://opendev.org/openstack/charm-cinder/commit/31b868eb209f97475ae2a37a84259bbb5ed09ff9
Submitter: "Zuul (22348)"
Branch: stable/train

commit 31b868eb209f97475ae2a37a84259bbb5ed09ff9
Author: dongdong tao <email address hidden>
Date: Mon Mar 28 11:50:41 2022 +0800

    Check if the newhost exists instead of currenthost

    Closes-Bug: #1956470

    Signed-off-by: Dongdong Tao <email address hidden>
    Change-Id: I2b9eec030a5b0f6d9a405cecea29bef04eb72f5d
    (cherry picked from commit 93dfc624d4325630dcbd3ba9d06c5f8d3f38845c)

tags: added: in-stable-train
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.