Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable libvirt URI #3

Open
mrblacyk opened this issue Feb 20, 2020 · 4 comments
Open

Configurable libvirt URI #3

mrblacyk opened this issue Feb 20, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@mrblacyk
Copy link
Owner

Right now code in aplibvirt.py is:

def connect(URI: str = "qemu:///system") -> libvirt.virConnect:
    """ Simple libvirt connect function """

    return libvirt.open(URI)

So it's ready to consume different URI.

What needs to be done:

  1. Make it dependant on some configuration from database
  2. Create proper webpage for it under sysadmin tools (maybe a general settings page which will include this particular settings?)
@mrblacyk mrblacyk added the enhancement New feature or request label Feb 20, 2020
@mrblacyk
Copy link
Owner Author

mrblacyk commented Mar 2, 2020

On it.

@mrblacyk mrblacyk self-assigned this Mar 2, 2020
@mrblacyk
Copy link
Owner Author

mrblacyk commented Mar 2, 2020

  • Prepared a basic configuration in db0bda3
  • Added Paramiko as required package in Pipfile in f8d5f9b

Next step is to create a private RSA key and store it in the database using this snippet:

from paramiko import RSAKey
from io import StringIO

# Generate key and make a string out of it
key = RSAKey.generate(4096)
pkey = StringIO()
key.write_private_key(pkey)
pkey_string = pkey.getvalue()  # Store in DB

# Make a RSA key out of string
key2 = RSAKey.from_private_key(pkey_string)
public_b64 = key2.get_base64()  # This part for authorized_keys file

@mrblacyk
Copy link
Owner Author

mrblacyk commented Mar 2, 2020

Overall, the idea is to create a wizard to establish qemu+libssh2:// communication to a hypervisor host so the application can be dockerized

@mrblacyk
Copy link
Owner Author

mrblacyk commented Mar 8, 2020

For now, passing /var/run/libvirt/libvirt-sock socket to docker must be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant