对卷id 75eb3e08-924f-4bf2-b403-6aebf4df48de 做备份:
cinder backup-create 75eb3e08-924f-4bf2-b403-6aebf4df48de --name wy_volume1_backup5 --force
但是日志里显示attach_info['volume_id'] = '1c13b2a5-fbd6-401f-801a-6bd2aa5b9a2c'
卷'1c13b2a5-fbd6-401f-801a-6bd2aa5b9a2c'看起来是nova创建的,而且deleted了:
原因:代码里获取备份设备的时候,判断如果原卷状态是in-use,则创建一个快照卷,‘1c13b2a5-fbd6-401f-801a-6bd2aa5b9a2c’就是新建的快照的卷id。
获取备份设备:
cinder.volume.driver.BaseVD#get_backup_device
def get_backup_device(self, context, backup):
"""Get a backup device from an existing volume.
The function returns a volume or snapshot to backup service,
and then backup service attaches the device and does backup.
"""
backup_device = None
is_snapshot = False
if self.backup_use_temp_snapshot() and CONF.backup_use_same_host:
(backup_device, is_snapshot) = (
self._get_backup_volume_temp_snapshot(context, backup))
else:
<!--程序走这!!!!-->
backup_device = self._get_backup_volume_temp_volume(
context, backup)
is_snapshot = False
cinder.volume.driver.BaseVD#_get_backup_volume_temp_volume
def _get_backup_volume_temp_volume(self, context, backup):
"""Return a volume to do backup.
To backup a snapshot, create a temp volume from the snapshot and
back it up.
Otherwise to backup an in-use volume, create a temp volume and
back it up.
"""
妈的线索又断了。。。。