Fix bug cannot get stack_id for scale_out vnf
After scale_out, tacker is getting stack_id from heat_client. However stack_id is not in heat.metadata. This will cause other lcm operations to this vnf_instance fail(like heal) For vnf_instances creted by instantiate interface, this problem does not happen because after instantiate, tacker will get stack_id from vnfc_res_info, not asking heat. This patch fixes this bug by change get stack_id logic after scale_out by getting physical_resource_id from target Heat AutoScalingGroup resource(vnfc_res_info) Closes-Bug: #1919434 Change-Id: I12fe98e51930c48da8540368c6b38f8254b0b68b
This commit is contained in:
parent
7e8a7351fa
commit
cca78f2932
|
@ -1377,11 +1377,7 @@ class OpenStack(abstract_driver.VnfAbstractDriver,
|
|||
rsc_info = heatclient.resource_get(
|
||||
scale_rsc.physical_resource_id,
|
||||
rsc.resource_name)
|
||||
meta = heatclient.resource_metadata(
|
||||
scale_rsc.physical_resource_id,
|
||||
rsc.resource_name)
|
||||
LOG.debug("rsc %s", rsc_info)
|
||||
LOG.debug("meta %s", meta)
|
||||
if 'COMPLETE' in rsc.resource_status and '\
|
||||
INIT_COMPLETE' != rsc.resource_status:
|
||||
vnfc_resource_info = objects.VnfcResourceInfo()
|
||||
|
@ -1396,8 +1392,9 @@ class OpenStack(abstract_driver.VnfAbstractDriver,
|
|||
resource.vim_level_resource_type = '\
|
||||
OS::Nova::Server'
|
||||
vnfc_resource_info.compute_resource = resource
|
||||
if meta:
|
||||
vnfc_resource_info.metadata = meta
|
||||
vnfc_resource_info.metadata.update(
|
||||
{"stack_id":
|
||||
scale_rsc.physical_resource_id})
|
||||
vnfc_resource_info.vnfc_cp_info = []
|
||||
volumes_attached = rsc_info.attributes.get(
|
||||
'os-extended-volumes:volumes_attached')
|
||||
|
|
Loading…
Reference in New Issue