software config/deploy return signal error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
StarlingX |
Won't Fix
|
Low
|
wanghao |
Bug Description
Title
-----
software config/deploy return signal error
Brief Description
-----------------
The return signal for a software config/deploy is sent using the external address instead of the public. The result is that the signal from guest to StarlingX will never be received.
Severity
--------
Critical
Steps to Reproduce
------------------
Run the following stack
#############
heat_template_
description: >
Minimal SoftwareDeployment
parameters:
flavor:
type: string
default: medium_flav
image:
type: string
default: ubuntu2
network:
default: net_a
type: string
user:
type: string
default: admin
resources:
my_key:
type: OS::Nova::KeyPair
properties:
name: my_key3
save_
user: {get_param: user}
my_security_
type: OS::Neutron:
properties:
rules:
- protocol: tcp
- protocol: icmp
my_port:
type: OS::Neutron::Port
properties:
network: {get_param: network}
security_
- default
- { get_resource: my_security_group }
my_software_
type: OS::Heat:
properties:
inputs:
- name: message
default: 'NONE'
outputs:
- name: file_content
group: script
config: |
#!/bin/sh -x
echo "PNYXTER EKO"
echo "${message}" > /tmp/pnyxter
cat /tmp/pnyxter > ${heat_
my_software_
type: OS::Heat:
properties:
signal_
config: {get_resource: my_software_config}
server: {get_resource: my_server}
input_values:
message: 'pnyxter mestxt'
my_server:
type: OS::Nova::Server
properties:
name: th3
image: {get_param: image}
flavor: {get_param: flavor}
key_name: {get_resource: my_key}
user_
networks:
- port: {get_resource: my_port}
outputs:
deploy_output:
value:
get_attr: [my_software_
stdout:
value:
get_attr: [my_software_
stderr:
value:
get_attr: [my_software_
status_code:
value:
get_attr: [my_software_
private_key:
value:
get_attr: [my_key, private_key]
public_key:
value:
get_attr: [my_key, public_key]
##################
Expected Behavior
------------------
The server resource should have lock like this:
{
"type": "String",
"name": "deploy_signal_id",
"value": "http://<public_
},
Actual Behavior
----------------
The server resource should have lock like this:
{
"type": "String",
"name": "deploy_signal_id",
"value": "http://<internal_
},
System Configuration
-------
One node
Branch/Pull Time/Commit
-------
ISO from http://
Solution
----------
Add the following line to signal_responder.py to /usr/lib/
from
https:/
i.e.
--- /usr/lib/
+++ /usr/lib/
@@ -158,6 +158,7 @@
+ signal_url = config_
else:
tags: |
added: stx.2.0 removed: stx.2019.05 |
Changed in starlingx: | |
assignee: | Al Bailey (albailey1974) → wanghao (wanghao749) |
From Al Bailey: 128.224. 151.57: 8000/v1/ waitcondition
---------------
The config url is set to: (public endpoint in my lab)
config_url http://
This is translated by the heat code to the internal url: 127.168. 204.2:8000/ v1/signal
http://
The WRS code that does that is here: /github. com/starlingx- staging/ stx-heat/ blob/master/ heat/engine/ resources/ signal_ responder. py#L150
https:/
This was done to fix CGTS-3907
If change that method to be similar to what upstream does, it should work for this customer as long as they are not using https or IPv6
This is the standard upstream code which does our alterations. /github. com/openstack/ heat/blob/ stable/ pike/heat/ engine/ resources/ signal_ responder. py#L144
https:/
If you want to demonstrate that this fix works in this scenario, this is the file that needs to be changed: python2. 7/site- packages/ heat/engine/ resources/ signal_ responder. py
/usr/lib/
find these lines (around line 155)
host_ addr,
cfg. CONF.heat_ api_cfn. bind_port,
"/v1" ,
signal_ type)
signal_url = "%s://%s:%s%s%s" % ("http",
and add the following one line right below it (which basically sets the variable to what upstream is doing) url.replace( '/waitcondition ', signal_type)
signal_url = config_
Note: This will not work with IPv6 and https
This will however work for the tests highlighted here
After you make this change (and make sure you backup the original file), you can restart heat engine:
sudo sm-restart service heat-engine
then you should be able to create their stack.
Note: the stack uses a keypair, which may or may not need to be manually cleaned up