Bug 1385457

Summary: [ocp-on-osp] Stack failed when using the suffix "_" with stack name
Product: OpenShift Container Platform Reporter: Gan Huang <ghuang>
Component: InstallerAssignee: Jan Provaznik <jprovazn>
Status: CLOSED CURRENTRELEASE QA Contact: Gan Huang <ghuang>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.3.0CC: aos-bugs, jokerman, jprovazn, mmccomas
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-20 08:38:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Gan Huang 2016-10-17 05:23:15 UTC
Description of problem:
The stack would fail if using the suffix "_" with stack name.

Version-Release number of selected component (if applicable):
v0.9.2

How reproducible:
always

Steps to Reproduce:
1.Create a stack which named to the suffix "_". E.g: ghuang-test_15
heat stack-create ghuang-test_15 -t 10800 -e ocp.yaml -f /usr/share/openshift-on-openstack/openshift.yaml
2.
3.

Actual results:
Stack was failed due to service "named" can't be started on bastion host.

-- Unit named.service has begun starting up.
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: dns_rdata_fromtext: openshift-cluster.zone:2: near 'ghuang-test_15-bastion': bad name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: dns_rdata_fromtext: openshift-cluster.zone:10: near 'ghuang-test_15-bastion': bad name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: openshift-cluster.zone:11: ghuang-test_15-bastion.example.com: bad owner name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: openshift-cluster.zone:12: ghuang-test_15-openshift-master-0.example.com: bad owner name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: openshift-cluster.zone:13: ghuang-test_15-openshift-master-1.example.com: bad owner name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: openshift-cluster.zone:14: ghuang-test_15-openshift-master-2.example.com: bad owner name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: openshift-cluster.zone:15: ghuang-test_15-openshift-infra-0.example.com: bad owner name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: openshift-cluster.zone:16: ghuang-test_15-openshift-infra-1.example.com: bad owner name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: openshift-cluster.zone:17: ghuang-test_15-openshift-node-rux9f429.example.com: bad owner name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: openshift-cluster.zone:18: ghuang-test_15-openshift-node-6b76p1f9.example.com: bad owner name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: openshift-cluster.zone:19: ghuang-test_15-lb.example.com: bad owner name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: zone example.com/IN: loading from master file openshift-cluster.zone failed: bad name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: zone example.com/IN: not loaded due to errors.
Oct 17 00:48:10 ghuang-test_15-bastion.example.com bash[12544]: _default/example.com/IN: bad name (check-names)
Oct 17 00:48:10 ghuang-test_15-bastion.example.com systemd[1]: named.service: control process exited, code=exited status=1
Oct 17 00:48:10 ghuang-test_15-bastion.example.com systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).


Expected results:
Stack can be created successfully if the stack name includes the suffix "_"

Additional info:
http://ben.goodacre.name/tech/Bad_owner_name_%28check-names%29_Error_%28BIND%29

Comment 1 Jan Provaznik 2016-10-17 07:48:49 UTC
stackname is used as part of instance hostnames, '_' is not a valid hostname character. We can add a heat stack validation constraint to check for '[a-z0-9-]' characters only.

Comment 2 Jan Provaznik 2016-10-17 08:06:05 UTC
Fixed in PR:
https://github.com/redhat-openstack/openshift-on-openstack/pull/283

Comment 4 Gan Huang 2016-10-19 01:41:23 UTC
Waiting for v0.9.4 which should include this fix.

Comment 5 Jan Provaznik 2016-10-19 14:50:35 UTC
Fixed in 0.9.4 (sorry for confusion, it was switched from MODIFIED to ON_QA automatically)

Comment 7 Gan Huang 2016-10-20 02:41:38 UTC
Verified with 0.9.4

1. Stack name with "_"
$ heat stack-create ghuang-auto_1 -t 10800 -e ocp.yaml -f /usr/share/openshift-on-openstack/openshift.yaml

ERROR: Property error: : resources.bastion_host.properties.hostname: : Hostname must contain only characters [a-z0-9\-].

2. lb_hostname with "_"
$ heat stack-create ghuang-test1 -t 10800 -e ocp.yaml -f /usr/share/openshift-on-openstack/openshift.yaml

ERROR: Property error: : resources.loadbalancer.properties.hostname: : Hostname must contain only characters [a-z0-9\-].