How to Install Tripleo(Openstack on Openstack) UnderCloud on CentOS 7

Install-undercloud-centos7

Undercloud is a single node OpenStack installation deployed either in a Virtual machine or in bare metal server. The objective of undercloud is to install, test, manage and update its overcloud servers (Controller, Compute & Storage nodes). In Red Hat terminology undercloud is known as “Director“. Undercloud basically contains all the images that is required to deployed Overcloud Controller, Computes, Swift and Storage.

Overcloud is the actual functional cloud for any organization where all the Virtual Machines are created on compute nodes and handle all the workloads. In other words we can say overcloud provides the openstack services like Nova, Keystone , Horizon, Neutron, cinder, Glance, Heat & Ceilometer Services.

In this article we will demonstrate how to install TripleO undercloud or Director on CentOS 7 VM.

Following are the minimum system requirements for undercloud:

  • 16 GB RAM
  • 1 Quad Core CPU
  • 80 GB disk Space
  • 2 Nics
  • CentOS 7.x / RHEL 7.x

Below are my lab setup details:

  • CentOS 7 VM (Minimal Installation) is hosted inside the KVM hypervisor.
  • Two Interfaces are attached to VM (Provisioning & NAT)
  • Provisioning Network: 192.168.126.0/24
  • NAT Network: 192.168.122.0/24
  • IP Address on eth0 is 192.168.122.90 and IP Address on eth1 is 192.168.126.1

To successfully install undercloud inside a virtual machine, you have to enabled Nested Virtualization in KVM hypervisor, if you not sure how to enable it, refer the below:

Let’s jump into the CentOS 7 VM and follow the below Steps:

Step:1) Set the Hostname and update /etc/hosts file

Run the hostnamectl command to set the hostname,

[[email protected] ~]# hostnamectl set-hostname "undercloud.example.com"
[[email protected] ~]# exec bash
[[email protected] ~]#

Add the following entries using the beneath command:

[[email protected] ~]# echo "192.168.126.1    undercloud.example.com" >> /etc/hosts

Update your system using below yum command and reboot once.

[[email protected] ~]# yum update -y && reboot

Step:2) Create non-root user (stack)

Run the beneath commands one after the another to create stack user and assign sudo rights to it. We will install undercloud using stack user only.

[[email protected] ~]# useradd stack
[[email protected] ~]# echo "enter_password_here" | passwd --stdin stack
[[email protected] ~]# echo "stack ALL=(root) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/stack
stack ALL=(root) NOPASSWD:ALL
[[email protected] ~]# chmod 0440 /etc/sudoers.d/stack
[[email protected] ~]# su - stack
[[email protected] ~]$

Step:3) Enable required repositories for undercloud

Execute the below commands to enable and configured required repositories for undercloud installation.

[[email protected] ~]$ wget https://trunk.rdoproject.org/centos7/current/python2-tripleo-repos-0.0.1-0.20190328140951.a7bc8dc.el7.noarch.rpm
[[email protected] ~]$ rpm -ivh python2-tripleo-repos-0.0.1-0.20190328140951.a7bc8dc.el7.noarch.rpm
[[email protected] ~]$ sudo -E tripleo-repos -b rocky current
[[email protected] ~]$ sudo yum -y install yum-plugin-priorities
[[email protected] ~]$ sudo yum install epel-release -y

Note : We can check the latest version of python2-tripleo-repos from RDO repository

Step:4) Install TripleO CLI package using yum command

[[email protected] ~]$ sudo yum install python-tripleoclient -y

Step:5) Copy & edit “undercloud.conf” sample file that suits to your env

[[email protected] ~]$ cp /usr/share/instack-undercloud/undercloud.conf.sample ~/undercloud.conf

Now edit ‘undercloud.conf‘ that suits to your environment, In my case I am adding the following content under “Default” Section

[[email protected] ~]$ vi undercloud.conf
[DEFAULT]
local_ip = 192.168.126.1/24
undercloud_public_vip = 192.168.126.2
undercloud_admin_vip = 192.168.126.3
local_interface = eth1
masquerade_network = 192.168.126.0/24
dhcp_start = 192.168.126.100
dhcp_end = 192.168.126.150
network_cidr = 192.168.126.0/24
network_gateway = 192.168.126.1
inspection_iprange = 192.168.126.160,192.168.126.199
generate_service_certificate = true
certificate_generation_ca = local
………………………………

Save and exit the file.

Step:6) Start undercloud installation using openstack command

Now start undercloud installation using below openstack command,

[[email protected] ~]$ openstack undercloud install

Once the installation is completed successfully, we will get the output something like below

Undercloud-installation-completed-message

Verify the OpenStack Service list

[[email protected] ~]$ source stackrc
(undercloud) [[email protected] ~]$ openstack service list
+----------------------------------+------------------+-------------------------+
| ID                               | Name             | Type                    |
+----------------------------------+------------------+-------------------------+
| 19f1261745004b31bc77dcb17a5ed4f5 | heat-cfn         | cloudformation          |
| 1bdd5dfbc36f444ebe62580d71f1a7ec | heat             | orchestration           |
| 2b39423f188b412d85bed43f112b35d7 | zaqar-websocket  | messaging-websocket     |
| 46f64d65be874718a1b2c123f588371b | keystone         | identity                |
| 605261da43d64395b72acc5309a22096 | mistral          | workflowv2              |
| 6f50fb704b224c1abc3c2a1a163eb73a | neutron          | network                 |
| 7110b7d7711a4aa1af6a3c13566be28f | zaqar            | messaging               |
| 7e41468745724ecfa8ed339137e8b700 | placement        | placement               |
| 853efa8a8acf403b827617725c3b7322 | ironic-inspector | baremetal-introspection |
| a5522e5df77343b99a0e47812323a17b | swift            | object-store            |
| b9bbb1a771704b57a0833d738bfb86e5 | glance           | image                   |
| d50fdfa25fb64c3e865c172754452ab1 | ironic           | baremetal               |
| e2ea283690c742d3a98bd1eae6f9b830 | nova             | compute                 |
+----------------------------------+------------------+-------------------------+
(undercloud) [[email protected] ~]$

This confirms that undercloud has been installed successfully. In the next article we will demonstrate how to import overcloud images in under cloud and how to create inventory file for overcloud servers and then we will see how we can deploy overcloud servers via undercloud.

Read More on: How to deploy TripleO Overcloud (Controller , Compute) on CentOS 7 VMs

In case this article helps you to understand how to install undercloud on CentOS 7 VM, please do share your feedback and comments.

28 Responses

  1. Sampath says:

    Good one. And also please provide overcloud install and configuration steps..in the next tutorial.

  2. Ranjeet says:

    nice article. Please publish article for overcloud install and configuration .

  3. Krishna says:

    How to do the step “Two Interfaces are attached to VM (Provisioning & NAT)” in Centos virt-manager ?

    virt-manager gui -> New VM -> Network selection -> Host device enpls0:macvtap
    Source mode : Bridge

    Like this?

  4. Harpreet Singh says:

    Hello Pardeep, actually I’m having issue while some sort of issues while setting the Networking Block for VM like Provisioning and NAT. I’ve done every thing, Enabled Nested Virtualization, Configure IP Forwarding but I don’t have the Network Connectivity between my VM and Host. even I’ve used ‘tcpdump’ to capture the traffic and I’ve got the result regarding ‘ARP’. both systems are not able to resolve ARP Requests. so plz help me to solve this issue
    My Setup : RHEL 7.3 as Host as well Guest( for UnderCloud )

  5. Ranjeet says:

    Please explain network address details.
    local_ip = 192.168.126.1/24
    undercloud_public_vip = 192.168.126.2
    undercloud_admin_vip = 192.168.126.3
    local_interface = eth1
    masquerade_network = 192.168.126.0/24
    dhcp_start = 192.168.126.100
    dhcp_end = 192.168.126.150
    network_cidr = 192.168.126.0/24
    network_gateway = 192.168.126.1
    inspection_iprange = 192.168.126.160,192.168.126.199
    generate_service_certificate = true
    certificate_generation_ca = local

  6. Jay says:

    Hello Pradeep, I have some confusion. Could you share about how to create Provisioning & NAT Network on KVM host ? Do physical interfaces need to be attached to the bridges belonged to Provisioning & NAT Network ? And do bridges need to be created with IPs ? Many thanks!

    • Pradeep Kumar says:

      Hi Jay,

      You need to create two networks i.e Provisioning and NAT using ‘virsh net-define’ on your KVM hypervisor, Specify the IP address range in the networks xml file,

      virsh net-define /tmp/provisioning.xml

      After creating the networks, attach these network to undercloud Interfaces via Bridges.

      • Jay says:

        hi Pradeep, I have successfully completed undercloud & overcloud installation. Thank you very much! !
        And I have other confusions. Thanks in advance.
        (1) Would it be OK if Provisiong Network not created using virsh net-define and I just create a bridge assigning IP address and then make undercloud & overcloud interfaces attached to the bridge ? if not, why ?
        (2) When configuring neutron, you know, which overcloud compute node interface should be attached to the bridge that will be configured in ”bridge_mappings = :” in openvswitch_agent.ini ? That means which interface is used to openstack VM network ?

  7. Ranjeet says:

    Hi Pradeep ,

    Please help me in tackling this error.

    [email protected] network-scripts]$ cat /home/stack/.instack/install-undercloud.log | less
    [[email protected] network-scripts]$ vi /home/stack/undercloud.conf
    [[email protected] network-scripts]$ cat /home/stack/.instack/install-undercloud.log | less
    [[email protected] network-scripts]$ vi /home/stack/undercloud.conf
    [[email protected] network-scripts]$ cat /home/stack/.instack/install-undercloud.log | less
    2018-04-12 21:00:16,199 INFO: Version:
    2018-04-12 21:00:16,199 INFO: Config: 1523580033
    2018-04-12 21:00:16,228 INFO: Puppet: 4.8.2
    2018-04-12 21:00:36,916 INFO: + rc=1
    2018-04-12 21:00:36,931 INFO: + set -e
    2018-04-12 21:00:36,956 INFO: + echo ‘puppet apply exited with exit code 1’
    2018-04-12 21:00:36,957 INFO: puppet apply exited with exit code 1
    2018-04-12 21:00:36,957 INFO: + ‘[‘ 1 ‘!=’ 2 -a 1 ‘!=’ 0 ‘]’
    2018-04-12 21:00:36,958 INFO: + exit 1
    2018-04-12 21:00:37,172 INFO: [2018-04-12 21:00:37,156] (os-refresh-config) [ERROR] during configure phase. [Command ‘[‘dib-run-parts’, ‘/usr/libexec/os-refresh-config/configure.d’]’ returned non-zero exit status 1]
    2018-04-12 21:00:37,178 INFO:
    2018-04-12 21:00:37,189 INFO: [2018-04-12 21:00:37,182] (os-refresh-config) [ERROR] Aborting…
    2018-04-12 21:00:37,726 DEBUG: An exception occurred
    Traceback (most recent call last):
    File “/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py”, line 2285, in install
    _run_orc(instack_env)
    File “/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py”, line 1592, in _run_orc
    _run_live_command(args, instack_env, ‘os-refresh-config’)
    File “/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py”, line 671, in _run_live_command
    raise RuntimeError(‘%s failed. See log for details.’ % name)
    RuntimeError: os-refresh-config failed. See log for details.
    2018-04-12 21:00:37,937 ERROR:

    • Ranjeet says:

      I was able to resolve this error by adding more memory to VM. I could figure out this on carefully inspecting log which was indicated that its not able to fork the process.

  8. Melborn De Chavez says:

    Kindly update. It seems to have a problem with repository

    failure: repodata/repomd.xml from delorean-current: [Errno 256] No more mirrors to try.
    https://trunk.rdoproject.org/centos7/f6/b8/f6b8de2dad0ecf1ff3c9de383be5$/repodat a/repomd.xml: [Errno 14] HTTPS Error 404 – Not Found

      • Wilson says:

        I have checked network settings, these added br-ctlplane and docker0 interface, and then original eth cannot have IP address, so can’t connect to internet, please help.

      • vikasreddy says:

        Hi Pradeep,

        Seems there is a problem with repository, i have encountered the below.

        failure: repodata/repomd.xml from delorean-current: [Errno 256] No more mirrors to try.
        ‘https://trunk.rdoproject.org/centos7/current/delorean.repo/repodata/repomd.xml’: [Errno 14] HTTPS Error 404 – Not Found

        also with the

        baseurl=’https://trunk.rdoproject.org/centos7/f6/b8/f6b8de2dad0ecf1ff3c9de383be5f12c873fcfa2_26625a85′

        both are not working. Please do needful.

        • Ashish Rawat says:

          Looks like you need to follow ‘https://trunk.rdoproject.org/centos7-master/current-passed-ci/delorean.repo’ this link each time if you face this issue, as this one contains the latest info.
          e.g. for now the repo link is ‘https://trunk.rdoproject.org/centos7/d8/ba/d8bae7b99708a308fb52ec13ae71f5a5f42a0a5d_e972080c’

          Also on step5 path has been changed. New path is
          cp /usr/share/python-tripleoclient/undercloud.conf.sample ~/undercloud.conf

          Thanks
          Ashish

  9. Wilson says:

    Hi Chris,

    I have modified the delorean-deps.repo or delorean.repo with your repo, but still cannot fix this issue.

    Thanks

    • Christopher says:

      Hi Wilson,

      I just modified the name and base_url line of the file from this article with the lines from the file I linked too.

      Chris

  10. Robert Wang says:

    I stuck at this stage, anyone can help?

    TASK [Run tripleo-container-image-prepare] **************************************************************************************************************************************************
    [WARNING]: Consider using ‘become’, ‘become_method’, and ‘become_user’ rather than running sudo
    fatal: [undercloud]: FAILED! => {“changed”: true, “cmd”: “sudo /usr/bin/tripleo-container-image-prepare –roles-file /tmp/ansible.3LG7JQ-role-data –environment-file /tmp/ansible.R937V3-prepare-param –cleanup partial 2> ../install-undercloud.log”, “delta”: “0:05:04.372270”, “end”: “2018-10-08 14:45:26.273667”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2018-10-08 14:40:21.901397”, “stderr”: “”, “stderr_lines”: [], “stdout”: “”, “stdout_lines”: []}

    NO MORE HOSTS LEFT **************************************************************************************************************************************************************************

    PLAY RECAP **********************************************************************************************************************************************************************************
    undercloud : ok=188 changed=101 unreachable=0 failed=1

    ** Found ansible errors for undercloud deployment! **
    [
    [
    “Run tripleo-container-image-prepare”,
    {
    “_ansible_parsed”: true,
    “stderr_lines”: [],
    “cmd”: “sudo /usr/bin/tripleo-container-image-prepare –roles-file /tmp/ansible.3LG7JQ-role-data –environment-file /tmp/ansible.R937V3-prepare-param –cleanup partial 2> ../install-undercloud.log”,
    “end”: “2018-10-08 14:45:26.273667”,
    “_ansible_no_log”: false,
    “stdout”: “”,
    “changed”: true,
    “rc”: 1,
    “start”: “2018-10-08 14:40:21.901397”,
    “warnings”: [
    “Consider using ‘become’, ‘become_method’, and ‘become_user’ rather than running sudo”
    ],
    “delta”: “0:05:04.372270”,
    “invocation”: {
    “module_args”: {
    “warn”: true,
    “executable”: null,
    “_uses_shell”: true,
    “_raw_params”: “sudo /usr/bin/tripleo-container-image-prepare –roles-file /tmp/ansible.3LG7JQ-role-data –environment-file /tmp/ansible.R937V3-prepare-param –cleanup partial 2> ../install-undercloud.log”,
    “removes”: null,
    “argv”: null,
    “creates”: null,
    “chdir”: null,
    “stdin”: null
    }
    },
    “stdout_lines”: [],
    “stderr”: “”,
    “msg”: “non-zero return code”
    }
    ]
    ]
    Install artifact is located at /home/stack/undercloud-install-20181008144526.tar.bzip2

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Deployment Failed!

  11. Muhammad Yunus says:

    For Step Number 3 :
    Change name and baseURL for the repository with the following :
    name=delorean-openstack-tempest-f60ad6c2010e9a65a993fbda9a35bf2a656c73d7
    baseurl=’https://trunk.rdoproject.org/centos7/f6/0a/f60ad6c2010e9a65a993fbda9a35bf2a656c73d7_4dcd3c2b’

    It worked for me ! thanks

  12. txaz2012 says:

    Hi Pradeep,
    I run into this issue
    [[email protected] ~]$ sudo -E tripleo-repos -b rocky current
    WARNING: –centos-mirror was deprecated in favour of –mirror
    Loaded plugins: fastestmirror, langpacks, priorities
    Loading mirror speeds from cached hostfile
    * base: centos.mirrors.tds.net
    * extras: mirrors.cat.pdx.edu
    * updates: mirror.linux.duke.edu
    Package yum-plugin-priorities-1.1.31-50.el7.noarch already installed and latest version
    Nothing to do
    Traceback (most recent call last):
    File “/bin/tripleo-repos”, line 10, in
    sys.exit(main())
    File “/usr/lib/python2.7/site-packages/tripleo_repos/main.py”, line 349, in main
    _install_repos(args, base_path)
    File “/usr/lib/python2.7/site-packages/tripleo_repos/main.py”, line 287, in _install_repos
    content = _get_repo(base_path + ‘current/delorean.repo’, args)
    File “/usr/lib/python2.7/site-packages/tripleo_repos/main.py”, line 143, in _get_repo
    r = requests.get(path)
    File “/usr/lib/python2.7/site-packages/requests/api.py”, line 68, in get
    return request(‘get’, url, **kwargs)
    File “/usr/lib/python2.7/site-packages/requests/api.py”, line 50, in request
    response = session.request(method=method, url=url, **kwargs)
    File “/usr/lib/python2.7/site-packages/requests/sessions.py”, line 464, in request
    resp = self.send(prep, **send_kwargs)
    File “/usr/lib/python2.7/site-packages/requests/sessions.py”, line 576, in send
    r = adapter.send(request, **kwargs)
    File “/usr/lib/python2.7/site-packages/requests/adapters.py”, line 431, in send
    raise SSLError(e, request=request)
    requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)

    Since this is just a Lab test to install openstack undercloud/overcloud process, Is there anyway I can make the SSL verify =False to bypass this error? Please advise. Thanks

    • Pradeep Kumar says:

      Hi , I would suggest you to update your system first(Director/Undercloud), using yum update command and reboot it and then give a try of above command

  13. Dipak Kumar says:

    Hi Pradeep,

    I am facing issue in the last step. Can you please help

    #openstack undercloud install
    .
    .
    .
    Exception: Error inspecting image: docker://docker.io/tripleorocky/centos-binary-cron:current-tripleo
    time=”2019-05-29T16:59:22+05:30″ level=fatal msg=”pinging docker registry returned: Get https://registry-1.docker.io/v2/: x509: certificate is valid for *.example.in, example.in, not registry-1.docker.io”

    Traceback (most recent call last):
    File “/usr/lib/python2.7/site-packages/tripleoclient/v1/tripleo_deploy.py”, line 1159, in _standalone_deploy
    parsed_args)
    File “/usr/lib/python2.7/site-packages/tripleoclient/v1/tripleo_deploy.py”, line 759, in _deploy_tripleo_heat_templates
    self._prepare_container_images(env, roles_data)
    File “/usr/lib/python2.7/site-packages/tripleoclient/v1/tripleo_deploy.py”, line 706, in _prepare_container_images
    env, roles_data, dry_run=True)
    File “/usr/lib/python2.7/site-packages/tripleo_common/image/kolla_builder.py”, line 178, in container_images_prepare_multi
    modify_only_with_labels=modify_only_with_labels,
    File “/usr/lib/python2.7/site-packages/tripleo_common/image/kolla_builder.py”, line 273, in container_images_prepare
    images, tag_from_label)
    File “/usr/lib/python2.7/site-packages/tripleo_common/image/image_uploader.py”, line 452, in discover_image_tags
    discover_args):
    File “/usr/lib/python2.7/site-packages/concurrent/futures/_base.py”, line 605, in result_iterator
    yield future.result()
    File “/usr/lib/python2.7/site-packages/concurrent/futures/_base.py”, line 429, in result
    return self.__get_result()
    File “/usr/lib/python2.7/site-packages/concurrent/futures/thread.py”, line 62, in run
    result = self.fn(*self.args, **self.kwargs)
    File “/usr/lib/python2.7/site-packages/tripleo_common/image/image_uploader.py”, line 556, in discover_tag_from_inspect
    i = DockerImageUploader._inspect(image_url.geturl(), insecure)
    File “/usr/lib/python2.7/site-packages/tenacity/__init__.py”, line 241, in wrapped_f
    return self.call(f, *args, **kw)
    File “/usr/lib/python2.7/site-packages/tenacity/__init__.py”, line 330, in call
    start_time=start_time)
    File “/usr/lib/python2.7/site-packages/tenacity/__init__.py”, line 297, in iter
    raise retry_exc.reraise()
    File “/usr/lib/python2.7/site-packages/tenacity/__init__.py”, line 136, in reraise
    raise self.last_attempt.result()
    File “/usr/lib/python2.7/site-packages/concurrent/futures/_base.py”, line 422, in result
    return self.__get_result()
    File “/usr/lib/python2.7/site-packages/tenacity/__init__.py”, line 333, in call
    result = fn(*args, **kwargs)
    File “/usr/lib/python2.7/site-packages/tripleo_common/image/image_uploader.py”, line 383, in _inspect
    (image, err))
    ImageUploaderException: Error inspecting image: docker://docker.io/tripleorocky/centos-binary-cron:current-tripleo
    time=”2019-05-29T16:59:22+05:30″ level=fatal msg=”pinging docker registry returned: Get https://registry-1.docker.io/v2/: x509: certificate is valid for *.example.in, example.in, not registry-1.docker.io”

  14. Diptendu says:

    Hi Pradeep,
    Can I implement the above on CentOS 7 VM on Oracle Virtual Box?

  15. Alex says:

    Hi Pradeep, thanks for sharing! Do you think this will work on ESXi VMs?

  16. Baljeet singh says:

    Hi , after successfully installation of undercloud.i m not able to see the openstack status list commant while in openstack service list is visble.can you expalin why ????

  17. Priya rai says:

    Hi Pradeep,
    For (TripleOdeployment Laptop Configuration -corei5/32GBRam/1 TB drive is that ok ?), Installed on centos7(Hostname is kvm-hypervisor) & KVM.
    But unable to configure network- Provisioning Network & Nat network)

    Can you please help???

    • Pradeep Kumar says:

      Hi Priya,

      Create an xml file of external and provisioning network and use following commands enable and start the network
      # virsh net-define /tmp/provisioning.xml
      # virsh net-autostart provisioning
      # virsh net-start provisioning

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest