Bug 1375422

Summary: Openshift is trying to find-out the OpenStack instance id by instance name.
Product: OKD Reporter: Jaroslav Henner <jhenner>
Component: PodAssignee: Seth Jennings <sjenning>
Status: CLOSED DUPLICATE QA Contact: DeShuai Ma <dma>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.xCC: aos-bugs, mmccomas
Target Milestone: ---Keywords: UpcomingRelease
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-13 18:27:25 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:
Embargoed:

Description Jaroslav Henner 2016-09-13 05:25:01 UTC
Description of problem:
When OpenShift node runs on OpenStack, it can be notified about it by setting an authentication URL and creds. In that case it is trying to guess the instance id of the VM by searching for instance with instance name same as the hostname. There however can be more of such instances if more of same (heat) stacks of openshift are running under same tenant (while running in completely different networks). For example a staging and production environment.

There is a better way to get the instance id -- use the uuid from the metadata :

[cloud-user@ose3-master-h57q6 ~]$ curl 'http://169.254.169.254/openstack/latest/meta_data.json' | json_reformat 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1711  100  1711    0     0  21236      0 --:--:-- --:--:-- --:--:-- 21387
{
    "random_seed": "...",
    "uuid": "44447f54-fed0-4d4a-9fed-b7cae0b610ce",
    "availability_zone": "nova",
    "keys": [
        {
            "data": "...",
            "type": "ssh",
            "name": "jenkins"
        }
    ],
    "hostname": "ose3-master-h57q6",
    "launch_index": 0,
    "public_keys": {
        "jenkins": "ssh-rsa ..."
    },
    "name": "ose3-master-h57q6"
}


Version-Release number of selected component (if applicable):
kubernetes.x86_64             1.2.0-0.13.gitec7364b.el7    rhel-extras-candidate
kubernetes-client.x86_64      1.2.0-0.13.gitec7364b.el7    rhel-extras-candidate
kubernetes-master.x86_64      1.2.0-0.13.gitec7364b.el7    rhel-extras-candidate
kubernetes-node.x86_64        1.2.0-0.13.gitec7364b.el7    rhel-extras-candidate


How reproducible:
always


Steps to Reproduce:
1. Boot the stack, rename the instance to some name.
2. start the atomic-openshift-node
3.


Actual results:
# journalctl -xe
zář 13 01:23:19 ose3-master-h57q6 atomic-openshift-node[50596]: I0913 01:23:19.645808   50596 openstack.go:289] Claiming to support Instances
zář 13 01:23:19 ose3-master-h57q6 atomic-openshift-node[50596]: E0913 01:23:19.695103   50596 kubelet.go:1131] Unable to construct api.Node object for kubelet: failed to get external ID from cloud provider: Failed to find object


Expected results:
No complains about the failure to get external ID.


Additional info:

Comment 2 Seth Jennings 2016-09-13 18:27:25 UTC
This is a dup of 1321964.

This is a known point of friction.  Docs do state that the nodeName must equal the instance name for the Openstack integration to work:

https://docs.openshift.org/latest/install_config/configuring_openstack.html#openstack-configuring-nodes-manually

We are working on this limitation:

https://bugzilla.redhat.com/show_bug.cgi?id=1367201

*** This bug has been marked as a duplicate of bug 1321964 ***