DIMSI-IS / BackROLL

BackROLL is a KVM guest backup software
https://cloud.dimsi.io
Apache License 2.0
34 stars 1 forks source link

Support Ceph disk (former Can't setup connect KVM server) #22

Open steven3579 opened 3 months ago

steven3579 commented 3 months ago

I performed the setup to connect KVM and CloudStack servers, but I'm currently encountering the error shown in the image. Has anyone else experienced a similar situation? Please guide me on how to fix this error. Thank Team 2024-06-06_10-47

nabdoul commented 3 months ago

Hi Steven,

Welcome to the project 😊

Could you please send us the result of the following command? Here is the command to run on your backroll machine:

sudo git log

Also, have you added the complete SSH key to your hypervisor (~/.ssh/authorized_keys)? To get the complete SSH key, you need to scroll down in backroll ssh-key.

Best regards, Navid

steven3579 commented 3 months ago

Hi Navid, Thank you for your response. Here is the log from the command you mentioned. I tried SSH directly from the core container to the KVM server, and it worked. However, the UI still shows the same error as befor. Screenshot from 2024-06-06 18-01-07

nabdoul commented 3 months ago

Hi @steven3579 ,

I've managed to reproduce your error:

Here's the solution to resolve the issue:

In the hypervisor, you need to modify the file /etc/ssh/sshd_config.

Add or uncomment the following line:

PubkeyAcceptedAlgorithms +ssh-rsa

Then, restart the service:

sudo service ssh restart

I hope this solution will help you resolve the problem.

Best regards, Navid

steven3579 commented 3 months ago

Hi @nabdoul It's working, thank you.

steven3579 commented 3 months ago

Hi @nabdoul After I connected to the KVM and tried to run the backup, it didn't work. The current model I am using has the VM disk located on shared storage using Ceph. Here is the error image I was provided. Additionally, I checked on my CloudStack server and there is no option to enter this backroll plugin. Could you provide me with any documentation on integrating CloudStack and backroll?

Backup framework provider plugin: backroll
Backup plugin backroll config appname: Name of your app name used for backroll api
Backup plugin backroll config password: Secret for the backroll_api found in your oauth provider.
Backup plugin backroll config url: URL of your backroll

Screenshot from 2024-06-09 21-45-22

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/celery/app/trace.py", line 451, in trace_task R = retval = fun(*args, *kwargs) File "/usr/local/lib/python3.8/dist-packages/celery/app/trace.py", line 734, in __protected_call__ return self.run(args, **kwargs) File "/usr/src/app/app/backup_tasks/single_backup.py", line 161, in single_vm_backup raise backup_error File "/usr/src/app/app/backup_tasks/single_backup.py", line 154, in single_vm_backup raise startbackup_error File "/usr/src/app/app/backup_tasks/single_backup.py", line 150, in single_vm_backup backup_result = backup_creation(virtual_machine_info) File "/usr/src/app/app/backup_tasks/single_backup.py", line 137, in backup_creation raise sequence_error File "/usr/src/app/app/backup_tasks/single_backup.py", line 133, in backup_creation return backup_sequence(info, host_info) File "/usr/src/app/app/backup_tasks/single_backup.py", line 43, in backup_sequence virtual_machine['storage'] = kvm_list_disk.getDisk(info, host_info) File "/usr/src/app/app/kvm/kvm_list_disk.py", line 45, in getDisk json.append({'device': device, 'source': source}) UnboundLocalError: local variable 'source' referenced before assignment

JoffreyLuang commented 3 months ago

Hi Steven,

The cloudstack plugin is not yet release. You have a backroll connector menu in Backroll which allows to connect Backroll to your Cloudstack. This way it allows Backroll to perform restore on CS VMs and allows to backup halted VMs. Since halted VMs are not available on hosts we query CS to retrieve the metadata.

As for the error you encounter, I am checking with the team and I will get back to you shortly

steven3579 commented 3 months ago

Hi @JoffreyLuang I will wait for information about the above error. Thank you

steven3579 commented 3 months ago

Hi @JoffreyLuang Could you please update me on the latest information regarding the issue I'm experiencing? I'm still waiting for your response. Thank you

m-dhellin commented 1 month ago

Hello @steven3579,

Sorry for the late response. Here is where the error is raised :

https://github.com/DIMSI-IS/BackROLL/blob/d78395a0f5272e4ea7642c1f4333e4868af4471a/src/core/app/kvm/kvm_list_disk.py#L24-L47

Based on the error in the logs you have provided, I understand that the XML description of the VM has no source node. Can you provide the XML description of your VM ? The node may be missing or maybe we have to update our parsing function.

steven3579 commented 1 month ago

Hello @m-dhellin This is the content of my XML VM file. `dumpxml --domain i-2-478-VM

i-2-478-VM a64b5202-51f3-49a2-a721-3024463d2c6d Ubuntu 22.04 LTS 1048576 1048576 1 642 /machine Apache Software Foundation CloudStack KVM Hypervisor a64b5202-51f3-49a2-a721-3024463d2c6d hvm qemu64 destroy restart destroy /usr/bin/qemu-system-x86_64 600dd17d19a54d9b97fd
m-dhellin commented 1 month ago

Hello @steven3579,

Thank you for your quick response. Here is the part of the XML that is extracted by the function :

<disk type='network' device='disk'>
    <driver name='qemu' type='raw' cache='none'/>
    <auth username='admin'>
        <secret type='ceph' uuid='2d26efa8-890b-3aa3-8d4c-2496d2d86b6a'/>
    </auth>
    <source protocol='rbd' name='backup/9becc35c-a6fa-4234-b1dd-6e74c27eb291' index='2'>
        <host name='x.x.x.89'/>
        <host name='x.x.x.90'/>
        <host name='x.x.x.91'/>
    </source>
    <target dev='vda' bus='virtio'/>
    <serial>600dd17d19a54d9b97fd</serial>
    <alias name='virtio-disk0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>

Indeed the Ceph RDB storage is not supported by Backroll.

We could use the Python library for Ceph & RDB to connect Backroll to your Ceph server but it seems that we need to access your secret for authentication.

I am thinking about an other way :