Flatcar icon indicating copy to clipboard operation
Flatcar copied to clipboard

[RFE] OVHcloud documentation

Open tormath1 opened this issue 1 year ago • 10 comments

Current situation

OVHcloud is powered by OpenStack (for the virtual machines) but there is no documentation to show how to import and use Flatcar OpenStack images on OVH.

Impact

It's "hard" to get Flatcar running on OVH.

Ideal future situation

  • [x] Flatcar documentation (https://github.com/flatcar/flatcar-website/pull/334)
  • [ ] Terraform examples

Additional information

Some notes I wrote during initial tests:

  • SSH keys injection works (afterburn)
  • coreos-metadata works (afterburn)
  • import the image with --property image_original_user=core and hw_qemu_guest_agent=yes
  • user-data (Ignition) can be added with Post-installation script from the portal

tormath1 avatar May 22 '24 11:05 tormath1

FYI @sbraz

chewi avatar May 22 '24 11:05 chewi

@tormath1 What is the additional property for?

I ran a couple tests the other week, and it seemed to work without it on OVH.

Haven't tested any specific OVH tooling, but I was able to start VMs with some internal code based on gophercloud.

till avatar May 22 '24 13:05 till

@till the additional property (image_original_user=core) is used by the UI to generate the right ssh command (core@INSTANCE-IP). The instance will work without it of course but it's more convenient if you use the UI. One additional property that can be set is hw_qemu_guest_agent=yes.

tormath1 avatar May 22 '24 13:05 tormath1

Yeah, I set the agent in all openstack clouds I use. Still works as advertised! 🥳

till avatar May 22 '24 13:05 till

Documentation PR has been opened: https://github.com/flatcar/flatcar-website/pull/334. For now it shows how to import / deploy Flatcar on OVH Cloud. @till @sbraz if you want to provide some feedback on the PR that would be great. :heart_eyes:

tormath1 avatar May 28 '24 15:05 tormath1

Documentation has been merged. Thanks @till @sbraz for the review / feedback! It's here: https://www.flatcar.org/docs/latest/installing/community-platforms/ovhcloud/ . On the engineering/documentation side, we should now implement a few Terraform examples to deploy something with Flatcar on OVH. Examples:

  • Kubernetes cluster on Brightbox (https://github.com/flatcar/flatcar-terraform/tree/main/brightbox)
  • Simple webserver on OpenStack (https://github.com/flatcar/flatcar-terraform/tree/main/openstack)

tormath1 avatar Jun 04 '24 06:06 tormath1

Do you also want to look into deploying it on OVHcloud bare metal? We have a terraform provider and we also support cloud-init: https://help.ovhcloud.com/csm/en-dedicated-servers-bringyourownimage?id=kb_article_view&sysparm_article=KB0043281

sbraz avatar Jun 04 '24 11:06 sbraz

@sbraz yes, we can give a try. I was curious about testing the BYOI feature. For the user-data, I think we would need to implement an Ignition provider to fetch them.

tormath1 avatar Jun 04 '24 13:06 tormath1

If I understand correctly, Ignition is some kind of cloud-init alternative?

In that case, yes, you'd need to implement something to fetch data from cloud-init's Config Drive (we use v2 with an ISO 9660 partition labelled config-2). FYI, @bapt implemented something similar in Lua for FreeBSD and called it nuageinit.

sbraz avatar Jun 04 '24 14:06 sbraz

@sbraz that's right, Ignition is a one-time provisioning software that runs from the initramfs. For OVHcloud it relies on OpenStack metadata service / config-drive. Maybe we can have it to work in a similar way on bare-metal.

tormath1 avatar Jun 05 '24 08:06 tormath1

Hi, we use flatcar+terraform on OVH for quite some time.

Here our implementation working in production

resource "openstack_images_image_v2" "flatcar" {
  for_each = var.os_image

  name             = "Flatcar ${each.value["arch"]} - ${each.value["version"]} ${each.value["release_channel"]}"
  region           = var.region
  image_source_url = "https://${each.value["release_channel"]}.release.flatcar-linux.net/${each.value["arch"]}-usr/${each.value["version"]}/flatcar_production_openstack_image.img.gz"
  # XXX do not use it, OVH openstack seems to not handle this well :(
  # web_download      = false
  verify_checksum  = true
  decompress       = true
  container_format = "bare"
  disk_format      = "qcow2"
  protected        = false
  hidden     = false
  visibility = "private"

  # See: https://docs.openstack.org/glance/stein/admin/useful-image-properties.html
  # See: https://wiki.openstack.org/wiki/VirtDriverImageProperties
  properties = {
    architecture              = each.value["arch"] == "amd64" ? "x86_64" : each.value["arch"]
    image_original_user       = "core"
    distro_family             = "gentoo"
    os_distro                 = "gentoo"
    os_version                = each.value["version"]
    os_release_channel        = each.value["release_channel"]
    os_arch                   = each.value["arch"]
    os_type                   = "linux"
    hw_disk_bus               = "scsi"
    hw_scsi_model             = "virtio-scsi"
    hypervisor_type           = "qemu"
    hw_qemu_guest_agent       = true
    hw_vif_model              = "virtio"
    hw_vif_multiqueue_enabled = true
    hw_time_hpet              = true
  }

  timeouts {
    create = "5m"
  }
}

The for_each is used to get different versions running

  os_image = {
    main = {
      distro          = "flatcar"
      arch            = "amd64"
      release_channel = "stable"
      version         = "3815.2.5"
    }
    canary = {
      distro          = "flatcar"
      arch            = "amd64"
      release_channel = "beta"
      version         = "current"
    }
  }

spnngl avatar Jul 30 '24 09:07 spnngl

@spnngl thanks for sharing this and kudos to your team to run Beta nodes. If you have a moment, would you consider upstreaming this example here: https://github.com/flatcar/flatcar-terraform? It will be referenced from the OVH documentation: https://www.flatcar.org/docs/latest/installing/community-platforms/ovhcloud/ as it can provide a good foundation for users who want to start on OVH with Flatcar.

We still need to check on the bare metal offer too what we can do.

tormath1 avatar Jul 30 '24 09:07 tormath1

@tormath1 I'll do it later We do not have that much beta nodes, we just want to check flatcar upgrades on them before the whole cluster. We had some bad surprises before :grimacing:

We use baremetal byoi with flatcar too but not with their MAAS offer. We use their API to do it, no terraform.

spnngl avatar Jul 30 '24 15:07 spnngl

@tormath1 Added example here: https://github.com/flatcar/flatcar-terraform/pull/27

Do you prefer a separate openstack-ovhcloud folder ?

spnngl avatar Aug 01 '24 12:08 spnngl