[tripleo] Standalone setup is unable to deploy Octavia

Bug #1806113 reported by Raoul Scarazzini on 2018-11-30
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
High
Bogdan Dobrelya

Bug Description

I'm trying to deploy for testing purposes a standalone setup. I'm using this config:

parameter_defaults:
  CloudName: <MYIP>
  # default gateway
  ControlPlaneStaticRoutes:
    - ip_netmask: 0.0.0.0/0
      next_hop: <MYGW>
      default: true
  Debug: true
  DeploymentUser: stack
  DnsServers:
    - <MYDNS>
  NtpServer:
    - <MYNTP>
  # needed for vip & pacemaker
  KernelIpNonLocalBind: 1
  DockerInsecureRegistryAddress:
    - <MYIP>:8787
    - <MYDOCKERREGISTRY>
  NeutronPublicInterface: eth0
  # domain name used by the host
  NeutronDnsDomain: foundation.demo
  # i'm just adding random flags pretending i know what i'm doing
  # stop pretending you all-mighty
  NeutronEnableInternalDNS: true
  DnsServers: ["<MYDNS>"]
  # re-use ctlplane bridge for public net, defined in the standalone
  # net config (do not change unless you know what you're doing)
  NeutronBridgeMappings: datacentre:br-ctlplane
  NeutronPhysicalBridge: br-ctlplane
  # enable to force metadata for public net
  #NeutronEnableForceMetadata: true
  StandaloneEnableRoutedNetworks: false
  StandaloneHomeDir: /home/stack
  StandaloneLocalMtu: 1500
  # Needed if running in a VM, not needed if on baremetal
  #StandaloneExtraConfig:
  # nova::compute::libvirt::services::libvirt_virt_type: qemu
  # nova::compute::libvirt::libvirt_virt_type: qemu
  HeatEngineOptVolumes:
    - /usr/lib/heat:/usr/lib/heat:ro

resource_registry:
  OS::TripleO::Services::HeatApi: /usr/share/openstack-tripleo-heat-templates/docker/services/heat-api.yaml
  OS::TripleO::Services::HeatApiCfn: /usr/share/openstack-tripleo-heat-templates/docker/services/heat-api-cfn.yaml
  OS::TripleO::Services::HeatEngine: /usr/share/openstack-tripleo-heat-templates/docker/services/heat-engine.yaml
  OS::TripleO::Services::OctaviaApi: /usr/share/openstack-tripleo-heat-templates/docker/services/octavia-api.yaml
  OS::TripleO::Services::OctaviaDeploymentConfig: /usr/share/openstack-tripleo-heat-templates/docker/services/octavia/octavia-deployment-config.yaml
  OS::TripleO::Services::OctaviaHealthManager: /usr/share/openstack-tripleo-heat-templates/docker/services/octavia-health-manager.yaml
  OS::TripleO::Services::OctaviaHousekeeping: /usr/share/openstack-tripleo-heat-templates/docker/services/octavia-housekeeping.yaml
  OS::TripleO::Services::OctaviaWorker: /usr/share/openstack-tripleo-heat-templates/docker/services/octavia-worker.yaml

I'm able to get it working with the usual command line:

sudo openstack tripleo deploy --templates --local-ip=10.19.227.125/24 -e /usr/share/openstack-tripleo-heat-templates/environments/standalone.yaml -r /usr/share/openstack-tripleo-heat-templates/roles/Standalone.yaml -e $HOME/containers-prepare-parameters.yaml -e $HOME/standalone_parameters.yaml --output-dir $HOME/workdir --standalone

But then, if I try to add the Octavia bits, like this:

sudo openstack tripleo deploy --templates --local-ip=10.19.227.125/24 -e /usr/share/openstack-tripleo-heat-templates/environments/standalone.yaml -r /usr/share/openstack-tripleo-heat-templates/roles/Standalone.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/services/octavia.yaml -e $HOME/containers-prepare-parameters.yaml -e $HOME/standalone_parameters.yaml --output-dir $HOME/workdir --standalone

I get:

** Performing Heat stack create.. **
Exception: ERROR: EndpointNotFound: resources.StandaloneServiceChain<file:///home/stack/workdir/tripleo-heat-installer-templates/common/services.yaml>.resources.ServiceChain<nested_stack>.resources.128<file:///home/stack/workdir/tripleo-heat-installer-templates/docker/services/octavia/octavia-deployment-config.yaml>.resources.default_key_pair: publicURL endpoint for compute service in regionOne region not found
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/tripleo_deploy.py", line 1063, in _standalone_deploy
    parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/tripleo_deploy.py", line 708, in _deploy_tripleo_heat_templates
    stack = orchestration_client.stacks.create(**stack_args)
  File "/usr/lib/python2.7/site-packages/heatclient/v1/stacks.py", line 171, in create
    data=kwargs, headers=headers)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 292, in post
    return self.client_request("POST", url, **kwargs)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 282, in client_request
    resp, body = self.json_request(method, url, **kwargs)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 271, in json_request
    resp = self._http_request(url, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 234, in _http_request
    raise exc.from_response(resp)
HTTPBadRequest: ERROR: EndpointNotFound: resources.StandaloneServiceChain<file:///home/stack/workdir/tripleo-heat-installer-templates/common/services.yaml>.resources.ServiceChain<nested_stack>.resources.128<file:///home/stack/workdir/tripleo-heat-installer-templates/docker/services/octavia/octavia-deployment-config.yaml>.resources.default_key_pair: publicURL endpoint for compute service in regionOne region not found
None
Not cleaning working directory /home/stack/workdir/tripleo-heat-installer-templates
Not cleaning ansible directory /home/stack/workdir/undercloud-ansible-QVZJDh
Install artifact is located at /home/stack/workdir/undercloud-install-20181130192536.tar.bzip2

Do you have any suggestion on how to make this work, or is it simply not supported and so this can't be considered a bug?

Alex Schultz (alex-schultz) wrote :

Yea this won't work right now because it wants to query nova for the default keypair but in the standalone there is no compute.

https://github.com/openstack/tripleo-heat-templates/blob/4daeccdac75d5c14b4f6ca14f8ab8e221d3af367/docker/services/octavia/octavia-deployment-config.yaml#L151

This likely could be worked around by allowing the end user provide a public key and only fall back to the default nova keypair when not provided.

Changed in tripleo:
importance: Undecided → Medium
milestone: none → stein-2
Bogdan Dobrelya (bogdando) wrote :

IIRC, Octavia deployment requires something already deployed, which is not the case for a very initial run of standalone deployment. I'd say it is yet supported for standalone. It might probably work though for a 2nd run of the same deployment command but added the env files for octavia

Bogdan Dobrelya (bogdando) wrote :

Oh yes, that "something" is the octavia deployment attempts to create a Nova keypair https://github.com/openstack/tripleo-heat-templates/blob/b01b1a7f7211e1f542bf39e63458934fa5c623b6/docker/services/octavia/octavia-deployment-config.yaml#L149-L151 before there is nova deployed.

Bernard Cafarelli (bcafarel) wrote :

Actually, this is used to grab the undercloud default key, which will be used when a SSH key is not provided:
https://github.com/openstack/tripleo-heat-templates/commit/0e87e640c88c316a8bc8d75974c8ac79aca868be

Disabling the relevant parts (to skip loading of this key) allows deployment to pass (also used at https://github.com/imain/ocp-doit/blob/master/octavia_hack.patch )

First suggestion to fix would then to skip loading the undercloud key if OctaviaAmphoraSshKeyFile is set (which would be a required parameter for standalone then)

I tried setting "OctaviaAmphoraSshKeyFile: '/root/.ssh/id_rsa.pub'" in my standalone_parameters.yaml, deployment passed and I had:
# grep -i amp_ssh /root/undercloud-ansible-bjNi8I/octavia-ansible/group_vars/octavia_vars.yaml
amp_ssh_key_name: octavia-ssh-key
amp_ssh_key_path: /root/.ssh/id_rsa.pub
# openstack keypair list

#

I suppose the missing key is caused by THT playbooks/roles/octavia-undercloud/tasks/main.yml not being run in standalone mode (also confirmed by default image I put at /usr/share/openstack-octavia-amphora-images/amphora-x64-haproxy.qcow2 not being uploaded to glance)

Bogdan Dobrelya (bogdando) wrote :

I'd raise it to high as there might be certain expectations for deploying OpenShift on top of LBaaS (Octavia) enabled openstack standalone (all-in-one) compact dev/test clouds. That is a very fast thus highly wanted way to get set up.

Changed in tripleo:
importance: Medium → High
Bogdan Dobrelya (bogdando) wrote :

We could make that OS::Nova::Keypair resource an optional thing via moving the template into jinja2 perhaps. And the "playbooks/roles/octavia-undercloud/tasks/main.yml not being run in standalone mode" part should be a trivial fix for quickstart.

Bogdan Dobrelya (bogdando) wrote :

oh wait, that's a playbook from tripleo-common...

Bogdan Dobrelya (bogdando) wrote :

@Bernard, with quickstart, octavia playbooks should be invoked if the deployment has the following in the ansible inventory vars:

standalone_custom_env_files: [{{ overcloud_templates_path }}/environments/services/octavia.yaml]

That probably provides all the needful for the final deployment command invoked from http://git.openstack.org/cgit/openstack/tripleo-quickstart-extras/tree/roles/standalone/templates/standalone.sh.j2

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

Changed in tripleo:
assignee: nobody → Bogdan Dobrelya (bogdando)
status: Triaged → In Progress
Changed in tripleo:
milestone: stein-2 → stein-3

Reviewed: https://review.openstack.org/628957
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=2a5baa5979c3283cb4b141b5520aa56285bf7d98
Submitter: Zuul
Branch: master

commit 2a5baa5979c3283cb4b141b5520aa56285bf7d98
Author: Bogdan Dobrelya <email address hidden>
Date: Mon Jan 7 15:07:21 2019 +0200

    Allow Octavia deployments for Standalone

    We have yet Nova for SSH keys management, when deploying a standalone
    cloud. Allow Octavia deployments for such a case as well.
    Jinja2 rendering of the octavia service template provides that
    functionality by relying on a new role tag 'standalone'.

    Change-Id: I69f3623646ec5b65109e0a4f0c16139018da9282
    Closes-bug: #1806113
    Co-Authored-By: Harald Jensas <email address hidden>
    Signed-off-by: Bogdan Dobrelya <email address hidden>

Changed in tripleo:
status: In Progress → Fix Released

This issue was fixed in the openstack/tripleo-heat-templates 10.4.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers