When the backup cannot find an available service, update the volume status to none
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
In Progress
|
Medium
|
ZhaoYixin |
Bug Description
When backing up by snapshot, the status of the volume will not change, so previous_status is none.
```
previous_status = volume['status']
......
if snapshot_id:
snapshot = objects.
data_timestamp = snapshot.created_at
self.db.
context, snapshot_id,
{'status': fields.
else:
self.db.
{'status': 'backing-up',
```
However, when the scheduler found that there was no service available, it did not judge whether it was backed up by snapshot, and directly updated the status of the volume to previous_status, causing the status of the volume to become none.
```
def create_backup(self, context, backup):
volume_id = backup.volume_id
volume = self.db.
try:
host = self.driver.
backup.host = host
backup.save()
self.
except exception.
self.
{'status': volume[
msg = "Service not found for creating backup."
LOG.error(msg)
vol_utils.
```
The process:
1.create a snapshot
2.no available backup services
3.create backup by snapshot
1.cinder snapshot-create 1a5cdc41-
2.cinder service-list
+------
| Binary | Host | Zone | Status | State | Updated_at | Cluster | Disabled Reason | Backend State |
+------
| cinder-backup | stor01 | nova | enabled | down | 2021-04-
| cinder-scheduler | ctl01 | nova | enabled | up | 2021-04-
| cinder-volume | stor01@ceph | nova | enabled | up | 2021-04-
+------
3.cinder backup-create 1a5cdc41-
4.cinder show 1a5cdc41-
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | None |
| updated_at | 2021-04-
Changed in cinder: | |
status: | New → In Progress |
Changed in cinder: | |
importance: | Undecided → Medium |
assignee: | nobody → ZhaoYixin (zhaoyixin) |
summary: |
- When the backup cannot find a available service, update the volume + When the backup cannot find an available service, update the volume status to none |
Fix proposed to branch: master /review. opendev. org/c/openstack /cinder/ +/797380
Review: https:/