Merge "[NSXv]: Push description to NSXv edge during creation"
This commit is contained in:
commit
5a2d30bbb3
@ -45,7 +45,8 @@ class EdgeApplianceDriver(object):
|
||||
def _assemble_edge(self, name, appliance_size="compact",
|
||||
deployment_container_id=None, datacenter_moid=None,
|
||||
enable_aesni=True, dist=False,
|
||||
enable_fips=False, remote_access=False):
|
||||
enable_fips=False, remote_access=False,
|
||||
description=None):
|
||||
edge = {
|
||||
'name': name,
|
||||
'fqdn': None,
|
||||
@ -62,6 +63,9 @@ class EdgeApplianceDriver(object):
|
||||
'applianceSize': appliance_size
|
||||
},
|
||||
}
|
||||
if description:
|
||||
edge['description'] = description
|
||||
|
||||
if not dist:
|
||||
edge['type'] = "gatewayServices"
|
||||
edge['vnics'] = {'vnics': []}
|
||||
@ -470,13 +474,15 @@ class EdgeApplianceDriver(object):
|
||||
|
||||
def deploy_edge(self, resource_id, name, internal_network, jobdata=None,
|
||||
dist=False, wait_for_exec=False, loadbalancer_enable=True,
|
||||
appliance_size=nsxv_constants.LARGE, async=True):
|
||||
appliance_size=nsxv_constants.LARGE, async=True,
|
||||
description=None):
|
||||
task_name = 'deploying-%s' % name
|
||||
edge_name = name
|
||||
edge = self._assemble_edge(
|
||||
edge_name, datacenter_moid=self.datacenter_moid,
|
||||
deployment_container_id=self.deployment_container_id,
|
||||
appliance_size=appliance_size, remote_access=True, dist=dist)
|
||||
appliance_size=appliance_size, remote_access=True, dist=dist,
|
||||
description=description)
|
||||
appliance = self._assemble_edge_appliance(self.resource_pool_id,
|
||||
self.datastore_id)
|
||||
if appliance:
|
||||
|
@ -30,6 +30,7 @@ from neutron.common import exceptions as n_exc
|
||||
from neutron import context as q_context
|
||||
from neutron.extensions import l3
|
||||
from neutron.plugins.common import constants as plugin_const
|
||||
from neutron import version
|
||||
|
||||
from vmware_nsx._i18n import _, _LE, _LW
|
||||
from vmware_nsx.common import exceptions as nsx_exc
|
||||
@ -137,7 +138,8 @@ class EdgeManager(object):
|
||||
lrouter['id'], lrouter['name'], internal_network=None,
|
||||
jobdata=jobdata, wait_for_exec=True,
|
||||
appliance_size=appliance_size,
|
||||
dist=(edge_type == nsxv_constants.VDR_EDGE), async=async)
|
||||
dist=(edge_type == nsxv_constants.VDR_EDGE), async=async,
|
||||
description=version.version_info.release_string())
|
||||
return task
|
||||
|
||||
def _deploy_backup_edges_on_db(self, context, num,
|
||||
@ -1395,7 +1397,8 @@ def create_lrouter(nsxv_manager, context, lrouter, lswitch=None, dist=False):
|
||||
# as we're not in a database transaction now
|
||||
task = nsxv_manager.deploy_edge(
|
||||
router_id, router_name, internal_network=None,
|
||||
dist=dist, jobdata=jobdata, appliance_size=appliance_size)
|
||||
dist=dist, jobdata=jobdata, appliance_size=appliance_size,
|
||||
description=version.version_info.release_string())
|
||||
task.wait(task_const.TaskState.RESULT)
|
||||
|
||||
|
||||
@ -1427,7 +1430,8 @@ def create_dhcp_service(context, nsxv_manager, network):
|
||||
# Deploy an Edge for dhcp service
|
||||
return nsxv_manager.deploy_edge(
|
||||
network['id'], edge_name, nsx_network_id, jobdata=jobdata,
|
||||
appliance_size=vcns_const.SERVICE_SIZE_MAPPING['dhcp'])
|
||||
appliance_size=vcns_const.SERVICE_SIZE_MAPPING['dhcp'],
|
||||
description=version.version_info.release_string())
|
||||
|
||||
|
||||
def delete_dhcp_service(context, nsxv_manager, network_id):
|
||||
|
@ -22,6 +22,7 @@ from neutron.common import exceptions as n_exc
|
||||
from neutron import context
|
||||
from neutron.plugins.common import constants as plugin_const
|
||||
from neutron.tests.unit import testlib_api
|
||||
from neutron import version
|
||||
from vmware_nsx.common import nsxv_constants
|
||||
from vmware_nsx.db import nsxv_db
|
||||
from vmware_nsx.plugins.nsx_v.vshield.common import (
|
||||
@ -131,7 +132,8 @@ class EdgeUtilsTestCase(EdgeUtilsTestCaseMixin):
|
||||
'lrouter': lrouter,
|
||||
'lswitch': None,
|
||||
'context': self.ctx},
|
||||
appliance_size=vcns_const.SERVICE_SIZE_MAPPING['router'])
|
||||
appliance_size=vcns_const.SERVICE_SIZE_MAPPING['router'],
|
||||
description=version.version_info.release_string())
|
||||
|
||||
|
||||
class EdgeManagerTestCase(EdgeUtilsTestCaseMixin):
|
||||
|
Loading…
Reference in New Issue
Block a user