neoave / mrack

Multicloud use-case based multihost async provisioner for CIs and testing during development
Apache License 2.0
11 stars 14 forks source link

feat: Virt a local virtual machine provider #102

Closed pvoborni closed 3 years ago

pvoborni commented 3 years ago

Sort of working PoC, Opening as a preview and for early comments.

This week, when looking at https://pagure.io/testcloud project, I was thinking that it can be used for the "libvirt" provider for Mrack. Basically the testcloud lib would do all the heavy lifting. Creating the provider was so-far super easy as I basically copy&pasted podman provider and just changed few things.

So far I tested:

Missing:

Used provisioning config changes:

virt:
    images:
        fedora-33: https://kojipkgs.fedoraproject.org/compose/cloud/Fedora-Cloud-33-20210421.0/compose/Cloud/x86_64/images/Fedora-Cloud-Base-33-20210421.0.x86_64.qcow2
    options: # default for undefined
        #vcpus: 2
        ram: 1024 # in MiB
        disksize: 10 # in GiB
    groups: # per-group overrides, similar to flavors
        ipaserver:
            ram: 2560
        ad:
            ram: 3072

feat: Virt a local virtual machine provider

PoC implementation which uses testcloud library to do most of the
heavy lifting. The idea is to use cloud images for local provisioning.

First implementation doesn't do much about image sources and expects
urls of images to be in provisioning config. Later this should be
improved to allow dynamic loading of latest images from the sources
without a need to change them often manually.

Signed-off-by: Petr Vobornik <pvoborni@redhat.com>

feat: password authentication in ssh_to_host

ssh_to_host had some code for password authentication but it never
worked so this is basically a new feature.

Password authentication is preferred over sshkey as sshkey is often
defined globally and preffering it would e.g. not work for virt
provider. It is assuming that if a host has a password set then
it should work.

Signed-off-by: Petr Vobornik <pvoborni@redhat.com>
pvoborni commented 3 years ago

How to test:

Do installation steps from testcloud:

Install the testcloud.

$ sudo dnf install testcloud

Add yourself to the testcloud group.

$ sudo usermod -a -G testcloud $USER

After installing mrack from rpm, only the second step will be needed. Mrack should probably somehow check if the user is part of the group and provide a hint if not.

pvoborni commented 3 years ago

This is ready for review. The packaging part should be done separately. Successfully tested with RHEL. And I see windows as a next RFE.

pvoborni commented 3 years ago

Also a next step would be some better solution about composes/images. E.g. so that we can somehow either automatically or semi-automatically fetch the latest image e.g. from https://kojipkgs.fedoraproject.org/compose/cloud/latest-Fedora-Cloud-33/ But this exact behavior is not yet well defined so starting without it is sufficient.