Skip to content

[Other] Setup productive SCS cluster at Cloud&Heat with Yaook on bare metal as FITKO PoC #544

Closed

Description

@anjastrunk

Provide a productive SCS cluster as PoC for FITKO. The cluster MUST be set up with the open source Lifecycle Management Tool for OpenStack and K8S Yaook and must be SCS compliant.

In contrast to #414, productive SCS cluster is set up on bare metal.

Activity

  1. added
    question
    SCS-VP10
    and removed
    question
    on Apr 2, 2024
  2. changed the title [-][Other] Setup productive SCS cluster at Cloud&Heat with Yaook[/-] [+][Other] Setup productive SCS cluster at Cloud&Heat with Yaook on bare metal[/+] on Apr 2, 2024
  3. martinmo commented on Apr 8, 2024

    @martinmo
    Member

    (Note: we initially used #414 as the sole issue to track both the provisioning of the virtual and the bare metal test clusters. For the sake of better documentation, we retroactively created this separate issue for the bare metal setup.)

    Current state is that the installation is completed and we have a working bare metal Yaook cluster. Thanks to the contributions of @cah-hbaum this OpenStack cluster is already SCS compliant, i.e., it fulfills the stabilized standards of the IaaS track (details can be found in #415 and in https://github.com/SovereignCloudStack/standards/tree/do-not-merge/scs-compliant-yaook/Informational). Here's a recap of what happened until we got to this point:

    Initial preparation for the Yaook bare metal installation started at the beginning of March. This involved a "rehearsal" of the installation procedure on an existing, simpler test cluster, because for me this was the first time conducting such an install and the hardware for the actual installation was not yet commisioned.

    During the rehearsal we already had network setup issues we needed to work around:

    • The first issues were related to VLAN tagging and caused connection issues between the Yaook Management Cluster and the install node. These were (probably) caused by some incompatibilities or misconfiguration of the network interfaces of the virtual install node and/or KVM (Proxmox). The exact cause is not known, because we gave up debugging at some point and switched to a bare metal install node, which immediately worked.
    • The second set of issues were related to PXE booting for the actual nodes that are supposed to be provisioned by ironic. These turned out to be firmware issues (a subset of the servers "forgot" its PXE configuration after reboot) as well as misleading and very well hidden BIOS settings (especially: PXE boot timeouts).

    The installation of the bare metal test cluster was conducted between March 11th and March 19th but we again bumped into a lot of technical difficulties. Debugging and fixing these was a bit more time consuming than usual because I am not yet 100% accustomed to the interactions of all the components.

    • Because this is going to be a productive cluster, the network setup is a lot more complex than the rehearsal install (more redundancy, stricter isolation). In addition to separate VLANs and subnets for different purposes, we also use several dedicated switches (e.g., for the Ceph nodes). This took several iterations and debugging sessions to get everything right, i.e., that all components supposed to be communicating could talk to each other.
    • Some trial and error was needed to get the netplan part of the cloud-init configuration right, also partly because I misunderstood the configuration. (This is very unfortunate and we will make this more robust and easier to verify in the future, e.g., by switching to interface selection by MAC address via the match keyword.)
    • During provisioning with ironic, a subset of the nodes repeatedly ended up in the clean failed state. It took some time to debug, but the Yaook bare metal logs contained the hint ("certificate not yet valid") and we finally figured out this was caused by an extremely out of sync hardware clock.
    • A similar, firmware setup/BIOS related error that cost us time was a still active hardware raid configuration on another subset of the nodes, which also lead to provisioning failures with ironic.
    • Finally, we had to troubleshoot some software issues that worked flawlessly before: e.g., during the automated install we ran into the problem that the K8s APT repositories were moved. Additionally, the CNI plugin (calico) installation failed initially, which we just fixed by switching to a different release.

    The next step will involve moving the hardware from our facility to its final location.

  4. anjastrunk commented on Apr 10, 2024

    @anjastrunk
    ContributorAuthor

    @cah-hbaum Please provide YAML output for SCS compatible IaaS v4, to proof cluster is SCS compliant.

  5. changed the title [-][Other] Setup productive SCS cluster at Cloud&Heat with Yaook on bare metal[/-] [+][Other] Setup productive SCS cluster at Cloud&Heat with Yaook on bare metal as FitKom PoC[/+] on Apr 10, 2024
  6. changed the title [-][Other] Setup productive SCS cluster at Cloud&Heat with Yaook on bare metal as FitKom PoC[/-] [+][Other] Setup productive SCS cluster at Cloud&Heat with Yaook on bare metal as FitKo PoC[/+] on Apr 10, 2024
  7. changed the title [-][Other] Setup productive SCS cluster at Cloud&Heat with Yaook on bare metal as FitKo PoC[/-] [+][Other] Setup productive SCS cluster at Cloud&Heat with Yaook on bare metal as FITKO PoC[/+] on Apr 10, 2024
  8. moved this from Backlog to Doing in Sovereign Cloud Stackon Apr 15, 2024
  9. martinmo commented on Apr 26, 2024

    @martinmo
    Member

    The next step will involve moving the hardware from our facility to its final location.

    Status update:

    • Hardware was successfully moved to the final location (I am unsure if I am allowed to reveal the location yet – please be patient, more infos will come soon) and the cluster is stable.
    • The next step is a proper network link, we currently use a temporary link.
  10. 21 remaining items

  11. martinmo commented on Jun 10, 2024

    @martinmo
    Member

    Update for multiple working days:

    • Health monitor is up and running and can be accessed via GitHub auth again
    • Issued new credentials for the compliance tests in GitHub and Zuul (Update auth_url endpoint and app credential id for poc-wgcloud #608)
    • Cinder issues have been resolved with the upgrade and the IaaS compliance tests run successfully (and including IaaS scope v4 this time 🎉)
    • Fixed a monitoring issue with prometheus caused by insufficient pod resource limits leading to OOMKilled crashloop
    • Looked into Ceph performance issues, but found no obvious mistakes or "low-hanging fruits" (issues can be seen "Resource wait" times in the OSHM)
  12. martinmo commented on Jun 11, 2024

    @martinmo
    Member

    Today I noticed, via the health monitor, that the apimon loop couldn't create volumes anymore. apimon logs showed that the volume quota was exceeded. Usually, APImon performs cleanup of old volumes, but it always failed with:

    volume status must be available or error or error_restoring or error_extending or error_managing and must not be migrating, attached, belong to a group, have snapshots, awaiting a transfer, or be disassociated from snapshots after volume transfer

    This was caused by dangling volumes which were still shown as attaching, attached or in-use, although openstack server list didn't show any running APIMonitor instances anymore. These, in turn, seem to appear because instance creation fails with errors like:

    Build of instance 68d71a43-e26e-4b34-8d93-37d5b29ab6bb aborted: Unable to update the attachment. (HTTP 500)

    which – I think – leaves the Cinder database in an inconsistent state.

    I stopped the apimon temporarily. Using cinder reset-state --state available --attach-status detached VOLUME_UUID for the respective volumes, I was able to reset the volume states so they could be deleted. I am now looking into the HTTP 500 "Unable to update the attachment" error.

  13. martinmo commented on Jun 11, 2024

    @martinmo
    Member

    I can only reproduce this with the load generated by the apimon. Volume operations do not always, but quite reliably fail. Based on my findings there is something going on with the message queue.

    In the cinder API logs, I see timeouts waiting for a reply for an operation, such as attachment_update. The volume manager says it couldn't send a reply because the queue was gone in the meantime. (Maybe the whole operation is just too slow and some kind of garbage collection for the queue kicks in too early?)

    Here is an relevant example snippet from the cinder volume manager logs:

    ...
    2024-06-11 14:12:49 INFO cinder.volume.manager Created volume successfully.
    2024-06-11 14:12:51 INFO cinder.volume.manager attachment_update completed successfully.
    2024-06-11 14:12:51 INFO cinder.volume.manager attachment_update completed successfully.
    2024-06-11 14:12:51 INFO cinder.volume.manager attachment_update completed successfully.
    2024-06-11 14:12:51 INFO cinder.volume.manager attachment_update completed successfully.
    2024-06-11 14:13:51 WARNING oslo_messaging._drivers.amqpdriver reply_3a06eb20db5d46318534af475f7c46c5 doesn't exist, drop reply to 1ffd3e1fb22d4007bc6b16c5d784f430
    2024-06-11 14:13:51 ERROR oslo_messaging._drivers.amqpdriver The reply 1ffd3e1fb22d4007bc6b16c5d784f430 failed to send after 60 seconds due to a missing queue (reply_3a06eb20db5d46318534af475f7c46c5). Abandoning...
    2024-06-11 14:13:51 INFO cinder.volume.manager Terminate volume connection completed successfully.
    2024-06-11 14:13:51 WARNING oslo_messaging._drivers.amqpdriver reply_3a06eb20db5d46318534af475f7c46c5 doesn't exist, drop reply to 73b1e4390fd74484ab8cbfbb7e376ad2
    ...
    

    And the matching ERROR with the same message ID 1ffd3e1fb22d4007bc6b16c5d784f430 from the cinder API logs:

    ...
    cinder-api-6494ffc69b-7jcwm: 2024-06-11 14:13:50 ERROR cinder.api.v3.attachments Unable to update the attachment.                                             
    Traceback (most recent call last):                                                                                                                            
      File "/usr/local/lib/python3.8/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 441, in get                                                       
        return self._queues[msg_id].get(block=True, timeout=timeout)                                                                                              
      File "/usr/local/lib/python3.8/site-packages/eventlet/queue.py", line 322, in get                                                                           
        return waiter.wait()                                                                                                                                      
      File "/usr/local/lib/python3.8/site-packages/eventlet/queue.py", line 141, in wait                                                                          
        return get_hub().switch()                                                                                                                                 
      File "/usr/local/lib/python3.8/site-packages/eventlet/hubs/hub.py", line 313, in switch                                                                     
        return self.greenlet.switch()                                                                                                                             
    _queue.Empty                                                                                                                                                  
    During handling of the above exception, another exception occurred:                                                                                           
    Traceback (most recent call last):                                                                                                                            
      File "/usr/local/lib/python3.8/site-packages/cinder/api/v3/attachments.py", line 250, in update                                                             
        self.volume_api.attachment_update(context,                                                                                                                
      File "/usr/local/lib/python3.8/site-packages/decorator.py", line 232, in fun                                                                                
        return caller(func, *(extras + args), **kw)                                                                                                               
      File "/usr/local/lib/python3.8/site-packages/cinder/coordination.py", line 200, in _synchronized                                                            
        return f(*a, **k)                                                                                                                                         
      File "/usr/local/lib/python3.8/site-packages/cinder/volume/api.py", line 2535, in attachment_update                                                         
        self.volume_rpcapi.attachment_update(ctxt,                                                                                                                
      File "/usr/local/lib/python3.8/site-packages/cinder/rpc.py", line 200, in _wrapper                                                                          
        return f(self, *args, **kwargs)                                                                                                                           
      File "/usr/local/lib/python3.8/site-packages/cinder/volume/rpcapi.py", line 479, in attachment_update                                                       
        return cctxt.call(ctxt,                                                                                                                                   
      File "/usr/local/lib/python3.8/site-packages/oslo_messaging/rpc/client.py", line 189, in call                                                               
        result = self.transport._send(                                                                                                                            
      File "/usr/local/lib/python3.8/site-packages/oslo_messaging/transport.py", line 123, in _send                                                               
        return self._driver.send(target, ctxt, message,                                                                                                           
      File "/usr/local/lib/python3.8/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 689, in send                                                      
        return self._send(target, ctxt, message, wait_for_reply, timeout,                                                                                         
      File "/usr/local/lib/python3.8/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 678, in _send                                                     
        result = self._waiter.wait(msg_id, timeout,                                                                                                               
      File "/usr/local/lib/python3.8/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 567, in wait                                                      
        message = self.waiters.get(msg_id, timeout=timeout)                                                                                                       
      File "/usr/local/lib/python3.8/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 443, in get                                                       
        raise oslo_messaging.MessagingTimeout(                                                                                                                    
    oslo_messaging.exceptions.MessagingTimeout: Timed out waiting for a reply to message ID 1ffd3e1fb22d4007bc6b16c5d784f430                                      
    cinder-api-6494ffc69b-7jcwm: 2024-06-11 14:13:50 INFO cinder.api.openstack.wsgi HTTP exception thrown: Unable to update the attachment.                       
    cinder-api-6494ffc69b-7jcwm: 2024-06-11 14:13:50 INFO cinder.api.openstack.wsgi https://cinder-api.yaook.svc:8776/v3/2fc014a6dd014c0bb3b53494a5b86fa9/attachme
    nts/a788db16-75b0-46e8-b407-e7415b455427 returned with HTTP 500                                                                                               
    cinder-api-6494ffc69b-7jcwm: 2024-06-11 14:13:50 INFO eventlet.wsgi.server 10.2.1.10,127.0.0.1 "PUT /v3/2fc014a6dd014c0bb3b53494a5b86fa9/attachments/a788db16-
    75b0-46e8-b407-e7415b455427 HTTP/1.1" status: 500  len: 400 time: 60.0660729  
    ...
    
  14. added a commit that references this issue on Jun 11, 2024
  15. martinmo commented on Jun 17, 2024

    @martinmo
    Member

    Summary for multiple working days:

    • Investigated the volume attachment troubles and did a cleanup of the leaked volumes from time to time.
    • Sanity checked ceph cluster health again -> everything happy.
    • Sanity checked the cinder RabbitMQ with rabbitmqctl cluster_health and with rabbitmq-check.py from the yaook debugbox -> everything happy.
    • Switched to raw Debian 12 image for the apimon tests as suggested by Kurt, this helped speeding up the volume creation a lot.
    • Cross-checked/compared cinder and rabbitMQ configuration with other working deployments -> nothing suspicious.
    • Read through oslo_messaging and cinder sources to grasp how queues are created -> culprit found, it's a caching issue.
      • Previously, I assumed reply queues for RPC calls are always created on the fly according to the RPC reference from the nova docs: "Every consumer connects to a unique direct-based exchange via a unique exclusive queue; its life-cycle is limited to the message delivery; the exchange and queue identifiers are determined by a UUID generator".
      • However, this is not exactly true: oslo_messaging library creates reply queues with a random name on first use and caches the reply queue name in the RabbitDriver/AMQPDriverBase object, to avoid creating too many queues (see method _get_reply_q() in amqpdriver.py). So basically, there is a cached reply queue name for every cinder API worker (green)thread.
      • There is no code in cinder/oslo_messaging that ensures that the corresponding cached queue still exists.
        • side note: I also suspect there is no check if the queue was physically created and replicated to all rabbitmq replicas in the first place (and I reckon this would be hard to do, if performance matters).
      • During the weekly certificate rotation conducted by the Yaook operator, rabbitmq is reloaded/restarted to pick up the new certs. During this time, some of the reply queues get dropped but cinder API tries to use them anyways and fails.
        • e.g., [error] <0.27146.0> operation queue.declare caused a channel exception not_found: queue 'reply_ed3fbf13f2e7488c9cbd19f0ad13588d' in vhost '/' process is stopped by supervisor
        • observed problems with volume attachments start exactly at that point
    • Ultimately, a simple restart of the cinder-api processes helps (in yaook terms, a rolling restart of the cinder-api deployment) -> of course that's not a long term solution.
      • The last spike of resource errors in the health monitor was caused again by this issue, because cert rotation was yesterday night.
      • Other services that use RPC calls can be affected by this as well, such as nova-scheduler, nova-conductor and so on.
  16. martinmo commented on Jul 3, 2024

    @martinmo
    Member

    Update for the last few days:

    • Rolled out fixes for "RegreSSHion" vulnerability in openssh-server on cluster infra and oshm-driver instance (which hosts the health monitor).
    • Rolled out fixes for OSSA-2024-001 aka CVE-2024-32498 (see Yaook Security Advisory). We used the YAOOK_OP_VERSIONS_OVERRIDE approach to roll out the patched images for nova, nova-compute, cinder and glance without having to wait for the release of new Yaook Operator Helm Charts.
    • Fixed volume attachment quirk ("attached on None") of the oshm-driver instance.
    • Removed leaked volumes and restarted cinder-api again after the last cert rotation.
    • Further investigated a long term fix for the occassional volume attachment issue caused by stopped RabbitMQ queues:
      • There are different types of RabbitMQ queues, such as classic and quorum. For HA clusters, the vendor recommends quorum queues. Classic queues are deprecated and known to cause troubles during restarts, e.g., see discussions here, here, here and here.
      • Yaook, by default, configures OpenStack components to use quorum queues via the rabbit_quorum_queue=true setting in the [oslo_messaging_rabbit] section.
      • However, checking with rabbitmqctl list_queues name type state reveals that for the reply queues and some others, classic queues are still used. (It appears these are the transient queues.)
      • In oslo.messaging, there are some semi recent changes related to this:
      • I am about to evaluate these settings in our virtualized Yaook setup, but I had to upgrade that to Zed first.
      • Note there is, to my knowledge, no other way to force RabbitMQ to only use quorum queues (e.g., via policy).
    • There are some other tuning knobs which I am currently evaluating, especially worker counts in the affected services. It turns out, that basically all services, except glance, use the CPU count as the default.
  17. martinmo commented on Jul 5, 2024

    @martinmo
    Member

    Update wrt RabbitMQ / volume service issues:

    • rabbit_transient_quorum_queue can't be used, this setting is too new :(
    • Thanks to a coworker, we found another oslo.messaging setting worth tweaking: heartbeat_rate -> in Zed, default is 2, recommended is 3 (see https://review.opendev.org/c/openstack/oslo.messaging/+/875615)
    • In addition to that, I assembled all necessary settings for sensible worker counts in OpenStack services and carefully tested all of that in our virtualized SCS Yaook cluster.
    • I rolled out the corresponding changes in the productive cluster (nova, neutron, glance, cinder, barbican). Because Nova, Neutron and Cinder APIs were restarting, there was a very short interruption which can be seen in the Health Monitor, but everything is okay now again.
    • We will see on Monday, if these measures helped (remember: certificate rotation + RabbitMQ rolling restart is Sunday night).
  18. martinmo commented on Jul 11, 2024

    @martinmo
    Member

    Update:

    • Our APImon now uses a dedicated OpenStack project, i.e., not the same project where the oshm-driver instance is running. Because we need to cleanup leaked volume leftovers from time to time, this separation makes sense.
    • The oslo.messaging config and worker number changes from my last comment didn't help, unfortunately. The RabbitMQ reply queue issues that appear after regular certificate rotation + rolling restart remain. But, as I've written above, at least we know when it's happening and what can be done to restore service.
  19. added a commit that references this issue on Jul 12, 2024
  20. martinmo commented on Jul 18, 2024

    @martinmo
    Member

    Update: today we rolled out new RabbitMQ version and applied tuned RabbitMQ settings for all four (colocated) RabbitMQ instances (each in turn 3x replicated) to reduce CPU contention on the (OpenStack) control plane nodes.

  21. martinmo commented on Jul 22, 2024

    @martinmo
    Member

    The last change finally did resolve our RabbitMQ issue. There are no more stopped reply queues left after the rolling restart (i.e., after RabbitMQ failover) and there are also no OpenStack API errors anymore, even during the restart.

  22. mbuechse commented on Aug 21, 2024

    @mbuechse
    Contributor

    Can this be closed?

  23. martinmo commented on Aug 22, 2024

    @martinmo
    Member

    Actually, yes 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

SCS-VP10

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions