Page 1 of 1
Cloned vms cannot register
Posted: 20. Nov 2020, 14:17
by Alex80
Hi All!
I just wanted to make a clone with the following command and I got an error:
Code: Select all
[vbox@jean-host mentes]$ VBoxManage clonevm teszt --basefolder=/media/usbdisk/ --name=teszt_clone
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...
Progress state: NS_ERROR_INVALID_ARG
VBoxManage: error: Clone VM failed
VBoxManage: error: Cannot register the hard disk '/media/usbdisk/teszt_clone/teszt_clone.vdi' {72a78f54-6bb7-414d-9a43-66ce16fb8249} because a hard disk '/media/usbdisk/teszt_clone/teszt_clone.vdi' with UUID {b9eae1f5-33eb-4e54-9e07-ef239eee58d4} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox
VBoxManage: error: Context: "RTEXITCODE handleCloneVM(HandlerArg*)" at line 610 of file VBoxManageMisc.cpp
There is no vms with UUID {b9eae1f5-33eb-4e54-9e07-ef239eee58d4}:
Code: Select all
VBoxManage list vms
"tesztjoinhoz" {133a2463-7b26-4ba4-8fe4-724a5c3fc42a}
"jean-master" {0374cb72-7c32-4363-969d-e97ae307cbf1}
"jean-slave" {380c1a2a-6206-4fa5-b975-c1761a5600c8}
"jean-oracle" {ff9e9d64-5f0c-46a5-9fcb-45a35ada98fd}
"teszt" {a62b2803-2171-42d7-aa34-d2b5074afdd6}
By the way as I know, the clone mechanism always change the UUID during the clone process in order to can be used in the same VirtualBox. So I surprised about this error message. I have tried it several times, but the result was the same and the VirtualBox always want to give the same new UUID ({b9eae1f5-33eb-4e54-9e07-ef239eee58d4}). Is it normal?
What"s going on?
I hope somebody can help me, many thanks in advance.
Re: Cloned vms cannot register
Posted: 20. Nov 2020, 14:22
by mpack
Zip up the .vbox file for this VM and attach the zip here.
But on the face of it, you have a conflicting filename: two VDIs with the same name but different UUIDs, and you have mangled the folder structure so that it's possible for the two to collide.
Re: Cloned vms cannot register
Posted: 20. Nov 2020, 15:57
by Alex80
mpack wrote:Zip up the .vbox file for this VM and attach the zip here.
I attached!
Re: Cloned vms cannot register
Posted: 20. Nov 2020, 16:21
by Alex80
mpack wrote: But on the face of it, you have a conflicting filename: two VDIs with the same name but different UUIDs, and you have mangled the folder structure so that it's possible for the two to collide.
I wanna run a shell script every week, which make a clone to an external HDD. First, the script delete the old clone version, and after that make a clone with the same name. It is impossible?
Re: Cloned vms cannot register
Posted: 20. Nov 2020, 17:54
by mpack
The .vbox file you provided does not register either of the VDI UUIDs mentioned in the error message.
You should not be thinking in terms of cloning a hard disk for backup purposes. The entire VM folder should be considered as a unit and backed up as a unit. Incorrect treatment of separated files leads to errors exactly like this.
Re: Cloned vms cannot register
Posted: 20. Nov 2020, 18:22
by fth0
The error shown in the initial posting could be a consequential error already. Reboot the host and make sure to (re-)move the folder named test_clone before trying the command again. What error do you get if the destination folder doesn't exist before the command is executed?
Re: Cloned vms cannot register
Posted: 20. Nov 2020, 18:37
by Alex80
mpack wrote:The .vbox file you provided does not register either of the VDI UUIDs mentioned in the error message.
You should not be thinking in terms of cloning a hard disk for backup purposes. The entire VM folder should be considered as a unit and backed up as a unit. Incorrect treatment of separated files leads to errors exactly like this.
We have two different topic.
1) Why the cloning doesn't work? I can clone to an inside disk area with no error. I only can not clone this vms to this external HDD. It's strange.
2) In this script we make copy of the full VM folder to this external HDD. Because of the UUID is same, we can use imediatelly these copied versions on another VirtualBox, if it's necessary (for example: host machine crash). And we wanna make a clone to this external HDD. Because of the UUID different, we can use imediatelly these copied versions on the SAME VirtualBox, if it's necessary (for example: host machine works fine, just the VM crashed).
We have more 700 GB sized of VM machines. Immediate usability is important in a case of collapse.
Re: Cloned vms cannot register
Posted: 22. Nov 2020, 05:04
by scottgus1
Alex80 wrote:Immediate usability is important in a case of collapse.
Cloning changes UUIDs which might interfere with grub loaders and activation, and prevents FC file-compare to confirm backup integrity.
A straight normal file & folder copy of all the files in the guest older as well as any disk files outside the guest folder is an exact drop-in replacement of the original guest. Simply copy back over the failed files and the restore is complete. And the copies can be file-compared.
If the UUID change does not disturb your guest's grub loader or activation and you care to do trapeze without the safety net of a file-compare, then cloning would give the immediate ability to start a backup copy without having to restore the original. To put it more plainly, have you tested your backups? A backup that doesn't restore is at best an increased carbon footprint and at worst pink slips and lawsuits.
Alex80 wrote:the script delete the old clone version
If this is done via command-line host OS deletes, not through vboxmanage commands, then Virtualbox still thinks the clone is there in Virtualbox's records. First you'd have to unregister the clone and all its disk files from Virtualbox then delete the clone. Not removing the clone from Virtualbox might cause the condition that Mpack highlighted as the cause of the error.
Alex80 wrote:First, the script delete
If the clone deletes without the clone succeeding the you are left without a backup. Clone first to a different folder, then delete.
Re: Cloned vms cannot register
Posted: 23. Nov 2020, 12:22
by Alex80
OK i see the main points, it's getting cleaner and cleaner. Grateful thanks.