Defining actions DELETE,SUSPEND results in: "Cannot signal resource during [ACTION]"

Bug #1458095 reported by Job
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Pradeep Kumar Singh
Kilo
Fix Released
Medium
Angus Salkeld

Bug Description

Ubuntu14.04
Kilo
VMware driver

Using actions DELETE,SUSPEND with OS::Heat::SoftwareDeployment or OS::Heat::SoftwareComponent results in an error. Deletion of the template will fail and, if used for ASG, the resource won't be removed when downscaling:

ResourceFailure: Exception: Cannot signal resource during {DELETE,SUSPEND}

I tried with different signal_transports. Using the default actions works ok.

heat_template_version: 2014-10-16
...
  myconfig:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config: |
         #!/bin/bash
         ping 10.0.0.1 -c10

  mydeploy:
    type: OS::Heat::SoftwareDeployment
    properties:
      config: {get_param: myconfig}
      server: {get_resource: server}
      actions:
      - DELETE

  server:
    type: OS::Nova::Server
    properties:
      image: {get_param: image}
      flavor: {get_param: flavor}
      key_name: {get_param: key_name}
      availability_zone: { get_param: wb_availability_zone }
      networks:
        - network: { get_param: net_a }
      user_data_format: SOFTWARE_CONFIG
...

Job (jobcespedes)
summary: - Defining other actions than default: "Cannot signal resource during
- [ACTION]"
+ Defining other actions than defaults results in: "Cannot signal resource
+ during [ACTION]"
Job (jobcespedes)
description: updated
description: updated
summary: - Defining other actions than defaults results in: "Cannot signal resource
+ Defining actions DELETE,SUSPEND results in: "Cannot signal resource
during [ACTION]"
description: updated
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Can you confirm you are running Heat Kilo version 2015.1.0 which includes the fix for bug 1444087?

Changed in heat:
status: New → Incomplete
Revision history for this message
Job (jobcespedes) wrote :

Hi,

Yes. It´s Kilo: "2015.1.0-0ubuntu1~cloud0"

I don't think this is the same case as with bug 1444087:

I see that the script in SoftwareConfig is run when I delete the stack. The icmp packets get to the target machine. But then, it fails in the SoftwareDeployment resource deletion.
I got the same behavior when CREATE action in also added:
...
    actions:
      - CREATE
      - DELETE
...
I'm testing with this case scenario because I'd like to use it with VMs in AutoScalingGroup to do some actions before downscaling. I tried it but had a simlar behavior.

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Indeed, there is validation preventing the signal from even reaching the deployment resource:
http://git.openstack.org/cgit/openstack/heat/tree/heat/engine/resource.py#n1161

The tuple (self.SUSPEND, self.DELETE) should be replaced with a Resource.no_signal_actions which SoftwareDeployment can override.

Changed in heat:
status: Incomplete → Triaged
importance: Undecided → Medium
tags: added: kilo-backport-potential software-config
removed: heat softwaredeployment
Changed in heat:
assignee: nobody → pradeep kumar singh (pradeep-singh-u)
Revision history for this message
Pradeep Kumar Singh (pradeep-singh-u) wrote :

Hi Steve,

>>The tuple (self.SUSPEND, self.DELETE) should be replaced with a Resource.
>>no_signal_actions which SoftwareDeployment can override.

You mean to say Resource class needs to implement no_signal_action, which performs the validation.
And SoftwareDeployment should override is no_signal_action and simply return False, so that signal can be sent to the Resource.

Revision history for this message
Steve Baker (steve-stevebaker) wrote : Re: [Bug 1458095] Re: Defining actions DELETE, SUSPEND results in: "Cannot signal resource during [ACTION]"

On 05/06/15 17:04, pradeep kumar singh wrote:
> You mean to say Resource class needs to implement no_signal_action, which performs the validation.
> And SoftwareDeployment should override is no_signal_action and simply return False, so that signal can be sent to the Resource.
No, Resource needs a class attribute:

   no_signal_actions = (self.SUSPEND, self.DELETE)

The current code will use self.no_signal_actions to decide what signals
to process. Then SoftwareDeployment just needs to override
no_signal_actions to be an empty tule ()

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/189177
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=cb35fa33552bf2100cdc453704c55f1b5278f384
Submitter: Jenkins
Branch: master

commit cb35fa33552bf2100cdc453704c55f1b5278f384
Author: Pradeep Kumar Singh <email address hidden>
Date: Mon Jun 8 08:56:37 2015 +0530

    Signal SoftwareDeployment resource

    Currently defining actions DELETE,SUSPEND for
    resource SoftwareDeployment results in exception:
    "Cannot signal resource during [ACTION]". This patch
    fixes that by modifying the validation.

    Closes-Bug: #1458095

    Change-Id: If2d85c96bafac9512416274ae76882b6de91baea

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Angus Salkeld (asalkeld)
tags: removed: kilo-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/225537

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/kilo)

Reviewed: https://review.openstack.org/225537
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=8a2dcfaa8bfb966c5f985c2ad4890f836cb8d7ea
Submitter: Jenkins
Branch: stable/kilo

commit 8a2dcfaa8bfb966c5f985c2ad4890f836cb8d7ea
Author: Pradeep Kumar Singh <email address hidden>
Date: Mon Jun 8 08:56:37 2015 +0530

    Signal SoftwareDeployment resource

    Currently defining actions DELETE,SUSPEND for
    resource SoftwareDeployment results in exception:
    "Cannot signal resource during [ACTION]". This patch
    fixes that by modifying the validation.

    Closes-Bug: #1458095

    Change-Id: If2d85c96bafac9512416274ae76882b6de91baea
    (cherry picked from commit cb35fa33552bf2100cdc453704c55f1b5278f384)

Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-1 → 5.0.0
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.