Environment delete failure due to Instance.yaml removing server before removing dependent resources

Bug #1359998 reported by Brian Tully
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
Critical
Serg Melikyan

Bug Description

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)

Changed in murano:
status: New → Confirmed
importance: Undecided → Critical
Changed in murano:
milestone: none → juno-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

Fix proposed to branch: master
Review: https://review.openstack.org/118172

Changed in murano:
assignee: nobody → Serg Melikyan (smelikyan)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/118172
Committed: https://git.openstack.org/cgit/stackforge/murano/commit/?id=7a6f6c1c181ddbf37ea43b0fe53615abec6b754c
Submitter: Jenkins
Branch: master

commit 7a6f6c1c181ddbf37ea43b0fe53615abec6b754c
Author: Serg Melikyan <email address hidden>
Date: Mon Sep 1 18:38:21 2014 +0400

    Remove partial clean-up in Instance.destroy

    Instance class implementation is based on OS::Nova::Server
    resource in Heat and related networking resources. When deploy
    called on Instance number of resources are allocated in Heat.

    Some classes (e.g. descendants of Instance) can allocate other
    resources that depends on presence of resources allocated by Instance,
    for example HeatSWConfigInstance allocate OS::Heat::SoftwareDeployment
    that depends on underlying OS::Nova::Server.

    When Instance is destroyed and clean-up stage is finished underlying
    resources are removed from stack. But since some resources still depend
    on removed ones whole stack becomes invalid and deployment fails.

    This change implements quick workaround by removing resource clean-up
    in Instance class. Warning, this change introduce resource leak, cause
    resoures are allocated during Instance deployment now will be deleted
    only when whole Environment (and therefor stack) will be deleted.

    Change-Id: I772f0b35918cd554fcbe1e830766ec23d5641176
    Closes-Bug: #1359998

Changed in murano:
status: In Progress → Fix Committed
ruhe (ruhe)
Changed in murano:
milestone: juno-3 → juno-rc1
Changed in murano:
status: Fix Committed → Fix Released
Changed in murano:
milestone: juno-rc1 → 2014.2
Changed in murano:
milestone: 2014.2 → liberty-1
assignee: Serg Melikyan (smelikyan) → Kirill Zaitsev (kzaitsev)
assignee: Kirill Zaitsev (kzaitsev) → nobody
assignee: nobody → Serg Melikyan (smelikyan)
milestone: liberty-1 → none
Changed in murano:
milestone: none → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.