=== modified file 'nova/virt/libvirt/volume.py' --- nova/virt/libvirt/volume.py 2012-08-27 15:37:18 +0000 +++ nova/virt/libvirt/volume.py 2012-10-12 09:11:21 +0000 @@ -87,10 +87,19 @@ conf.target_bus = "virtio" conf.serial = connection_info.get('serial') netdisk_properties = connection_info['data'] - if netdisk_properties.get('auth_enabled'): - conf.auth_username = netdisk_properties['auth_username'] - conf.auth_secret_type = netdisk_properties['secret_type'] - conf.auth_secret_uuid = netdisk_properties['secret_uuid'] + if conf.source_protocol == 'rbd': + if (FLAGS.rbd_secret_uuid or + netdisk_properties.get('auth_enabled')): + conf.auth_username = (FLAGS.rbd_user or + netdisk_properties['auth_username']) + conf.auth_secret_type = netdisk_properties['secret_type'] + conf.auth_secret_uuid = (FLAGS.rbd_secret_uuid or + netdisk_properties['secret_uuid']) + else: + if netdisk_properties.get('auth_enabled'): + conf.auth_username = netdisk_properties['auth_username'] + conf.auth_secret_type = netdisk_properties['secret_type'] + conf.auth_secret_uuid = netdisk_properties['secret_uuid'] return conf