zipurman / oVIRT_Simple_Backup

A REST API backup using PHP for oVirt 4.2.x
GNU General Public License v3.0
56 stars 32 forks source link

Backup Failed Disk not attached. ovirt 4.3 #53

Closed tdhetrick closed 5 years ago

tdhetrick commented 5 years ago

Expected behaviour

Attach and complete backup

Actual behaviour

[2019-05-14:07:43:28] Backup Imaging - /0 - 0% Disk Not Attached [2019-05-14:07:43:27] Attaching Image - Disk(s) Attached [2019-05-14:07:43:26] Disk Dat Write Docker02_Disk01 - ffe57cdb-7347-4f80-8a90-838cb70c8a5f - true - virtio_scsi - 68719476736 - sd-NOT-FOUND - (a-b) [2019-05-14:07:43:26] !!!! BACKUP FAILED - DISK NOT FOUND !!!! [2019-05-14:07:43:21] Attach Disk ffe57cdb-7347-4f80-8a90-838cb70c8a5f [2019-05-14:07:36:32] Creating Backup Paths - Directories Available [2019-05-14:07:35:29] Creating Snapshot [2019-05-14:07:35:26] Starting Backup ... ee80ef9f-7d9a-4b4a-a495-bcd030b23442 Docker02

Steps to reproduct the behaviour

A completely standard installation with ovirt 4.3.3.7 Hosted-Engine. No Xen I is there a way to test the attach procedure outside of the application, or get more detailed error?

zipurman commented 5 years ago

Try the following:

On the SimpleBackupVM:

watch fdisk -l

Then run a backup and watch the above output to see if any disks are added and what they are labeled as.

What OS are you using on the SImpleBackupVM?

tdhetrick commented 5 years ago

Ok, just ran watch fdisk -l while I ran another backup, and no drives were added.

I am running Debian 9. I tried to follow your recommended install as close as possible.

I used sb_log() to get the $xml from sb_attach_disk()

            <disk_attachment><snapshot id=aea1a184-4c44-4bec-82da-5625a5a3e2ad/>
                <logical_name>/dev/</logical_name>
                <interface>virtio_scsi</interface>
                <disk id=ffe57cdb-7347-4f80-8a90-838cb70c8a5f>
                <bootable>false</bootable>
                <active>true</active>
                </disk_attachment>
                </disk>

I also sb_logged sb_next_drive_letter() to see what drive letters were passing through this function, seemed like it was starting whit "g", but i'm not sure I completely understand this role this function plays.

[2019-05-14:13:02:27] Attaching Image - Disk(s) Attached [2019-05-14:13:02:26] y [2019-05-14:13:02:26] x [2019-05-14:13:02:26] w [2019-05-14:13:02:26] v [2019-05-14:13:02:26] u [2019-05-14:13:02:26] t [2019-05-14:13:02:26] s [2019-05-14:13:02:26] r [2019-05-14:13:02:26] q [2019-05-14:13:02:26] p [2019-05-14:13:02:26] o [2019-05-14:13:02:26] n [2019-05-14:13:02:26] m [2019-05-14:13:02:26] l [2019-05-14:13:02:26] k [2019-05-14:13:02:26] j [2019-05-14:13:02:26] i [2019-05-14:13:02:26] h [2019-05-14:13:02:26] g [2019-05-14:13:02:26] Disk Dat Write Windows01_Disk1 - a5d9090f-a1ed-4bd7-8ba3-4288ceebbba8 - true - virtio_scsi - 34359738368 - sd-NOT-FOUND - (a-b) [2019-05-14:13:02:26] !!!! BACKUP FAILED - DISK NOT FOUND !!!! [2019-05-14:13:02:20] Attach Disk a5d9090f-a1ed-4bd7-8ba3-4288ceebbba8......

zipurman commented 5 years ago

Did you install using the installer script, or did you manually install step-by-step?

If the disk isnt being attached and visible in fdisk, then the script will not work.

The process it uses for a backup is:

 * backup single vm
 * comm/snapshot_status[vmuuid] - Create Snapshot
 * comm/backup_create_path - Create Path and XML Snapshot File
 * comm/backup_attach_image - Attach Disk(s) to backup VM
 * comm/backup_imaging - Image Disk(s)
 * comm/backup_detatch_image - Detatch Disk(s)
 * comm/snapshot_delete - Delete Snapshot

Check and make sure that the snapshot is being created on the targeted VM you are backing up. This will only be there while the backup is running, so you may have to refresh and watch closely.

Let me know.

tdhetrick commented 5 years ago

I ran the install script. The snapshots are being created and are all still there. I'm guessing they are not being removed because the backup is failing and it does not get to that step.

Is there anything that would prevent the local disk mount point from being created for the attachment?

zipurman commented 5 years ago

Try deleting all of the snapshots that the script created. Also, try rebooting the SimpleBackupVM.

Send me the output of each of the following:

cat /var/www/html/config.php

fdisk -l

df -h

ls /mnt/ -l

cat /etc/fstab

tdhetrick commented 5 years ago

I had a hunch that I messed up the install somehow, so I did it one more time, and it is working now. I think I missed a few steps in the VM setup doc. Thank you for your help.

zipurman commented 5 years ago

Glad to hear ;)