Merge "Bug #898290: iSCSI volume backend treats FLAGS.host as a hostname"
This commit is contained in:
commit
ae697c4f36
@ -440,7 +440,8 @@ DEFINE_string('image_service', 'nova.image.glance.GlanceImageService',
|
||||
'The service to use for retrieving and searching for images.')
|
||||
|
||||
DEFINE_string('host', socket.gethostname(),
|
||||
'name of this node')
|
||||
'Name of this node. This can be an opaque identifier. It is '
|
||||
'not necessarily a hostname, FQDN, or IP address.')
|
||||
|
||||
DEFINE_string('node_availability_zone', 'nova',
|
||||
'availability zone of this node')
|
||||
|
@ -47,6 +47,8 @@ flags.DEFINE_string('iscsi_target_prefix', 'iqn.2010-10.org.openstack:',
|
||||
'prefix for iscsi volumes')
|
||||
flags.DEFINE_string('iscsi_ip_address', '$my_ip',
|
||||
'use this ip for iscsi')
|
||||
flags.DEFINE_integer('iscsi_port', 3260,
|
||||
'The port that the iSCSI daemon is listening on')
|
||||
flags.DEFINE_string('rbd_pool', 'rbd',
|
||||
'the rbd pool in which volumes are stored')
|
||||
|
||||
@ -279,6 +281,11 @@ class ISCSIDriver(VolumeDriver):
|
||||
self.tgtadm.new_target(iscsi_name, iscsi_target)
|
||||
self.tgtadm.new_logicalunit(iscsi_target, 0, volume_path)
|
||||
|
||||
model_update = {}
|
||||
model_update['provider_location'] = _iscsi_location(
|
||||
FLAGS.iscsi_ip_address, iscsi_target, iscsi_name)
|
||||
return model_update
|
||||
|
||||
def remove_export(self, context, volume):
|
||||
"""Removes an export for a logical volume."""
|
||||
try:
|
||||
@ -923,12 +930,10 @@ class ZadaraBEDriver(ISCSIDriver):
|
||||
|
||||
sn_ip = response_node.findtext("SnIp")
|
||||
sn_iqn = response_node.findtext("IqnName")
|
||||
iscsi_portal = sn_ip + ":3260," + ("%s" % iscsi_target)
|
||||
|
||||
model_update = {}
|
||||
model_update['provider_location'] = ("%s %s" %
|
||||
(iscsi_portal,
|
||||
sn_iqn))
|
||||
model_update['provider_location'] = _iscsi_location(
|
||||
sn_ip, iscsi_target, sn_iqn)
|
||||
return model_update
|
||||
|
||||
def _get_qosgroup_summary(self):
|
||||
@ -977,3 +982,7 @@ class ZadaraBEDriver(ISCSIDriver):
|
||||
|
||||
drive_info = self._get_qosgroup_summary()
|
||||
return {'drive_qos_info': drive_info}
|
||||
|
||||
|
||||
def _iscsi_location(ip, target, iqn):
|
||||
return "%s:%s,%s %s" % (ip, FLAGS.iscsi_port, target, iqn)
|
||||
|
Loading…
Reference in New Issue
Block a user