在cinder中添加新的存储后端,也即实现一个新的volume driver,需要在新driver中提供如下的driver method:
ceph卷返回:
{
'driver_volume_type': 'rbd',
'data': {
'name': '%s/%s' % (self.configuration.rbd_pool,
volume['name']),
'hosts': hosts,
'ports': ports,
'auth_enabled': (self.configuration.rbd_user is not None),
'auth_username': self.configuration.rbd_user,
'secret_type': 'ceph',
'secret_uuid': self.configuration.rbd_secret_uuid,}
}
nbs卷返回:
{
"data": {
"access_mode": "rw",
"device_path": device_path,
"volume_id": self._get_nbs_id_from_volume(volume)
},
"driver_volume_type": "local",
}
{
"data": {
"access_mode": "rw",
"device_path": device_path,
"volume_id": volume['id'],
"host": volume['provider_location'],
},
"driver_volume_type": "local",
}
网易云新用户大礼包:https://www.163yun.com/gift
本文来自网易实践者社区,经作者管强授权发布。