Currently, when deleting an environment that contains resources that are dependent on the server being present, the environment/stack deletion fails because the destroy() function of Instance.yaml patches out the server as the first action, thereby stranding the other resources and preventing them from functioning and/or getting deleted. The destroy function should factor in server dependencies (e.g., Heat SW configs, anything that refers to IP address) so that all resources can be deleted successfully, resulting in a successfully deleted environment.
murano engine log output: https://gist.github.com/briantully/03bc68eaaf1b19383317
from Instance.yaml
destroy:
# Fixme(smelikyan): We need to remove all associated resources on destroy
Body:
- $template: $.environment.stack.current()
# Remove OS::Nova::Server resource
- $patchBlock:
op: remove
path: format('/resources/{0}', $.name)
- $template: patch($template, $patchBlock)
# Remove Ip Addresses Outputs assigned to this Instance
- $assignedIpBlock:
op: remove
path: format('/outputs/{0}-assigned-ip', $.name)
- $template: patch($template, $assignedIpBlock)
# Remove Floatting IP Addresses Outputs
- If: $.getAttr(fipAssigned, false)
Then:
- $assignedFloatingIpBlock:
op: remove
path: format('/outputs/{0}-FloatingIPaddress', $.name)
- $template: patch($template, $assignedFloatingIpBlock)
- $.environment.stack.setTemplate($template)
- $.environment.stack.push()
- $.environment.instanceNotifier.untrackCloudInstance($this)
Fix proposed to branch: master /review. openstack. org/118172
Review: https:/