VirtualBox

Ticket #9077 (new defect)

Opened 3 years ago

Last modified 3 years ago

VBoxManage showhdinfo fails on hdd with same uuid as different existing hdd

Reported by: neuron Owned by:
Priority: major Component: other
Version: VirtualBox 4.0.8 Keywords:
Cc: Guest type: other
Host type: other

Description

Short story:

$ /usr/bin/VBoxManage --nologo showhdinfo /tank/vm/admin/osol167_full/osol167.vdi
VBoxManage: error: Cannot register the hard disk '/tank/vm/admin/osol167_full/osol167.vdi' {931723e7-389c-412e-b9b7-2e2e5ac7f88f} because a hard disk '/tank/vm/admin/osol167/osol167.vdi' with UUID {931723e7-389c-412e-b9b7-2e2e5ac7f88f} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, AccessMode_ReadWrite, pMedium.asOutParam())" at line 209 of file VBoxManageDisk.cpp

I don't want to register the hard disk, I just want to know it's UUID.

Long story:

I have running virtual machine. I want to duplicate the machine using zfs snapshot/clone . (reason for this is that it's very fast, lest than second, and occupies no additional space as it uses copy on write). What I have been doing in the past:

  • read hdd's UUID
  • modify hdd's UUID via internalcommand setvduuid/sethduuid
  • read new hdd's UUID
  • edit machine's configuration *.xml so that I replace the old UUID by new UUID.

All this in a script. This has been working with VirtualBox 3.x. After upgrade to latest 4.x it shows the error I'm complaining about.

Possible workarounds:

  • ignore that showhdinfo failed and read the disk's UUID from error message. This is what I'm doing now. I don't like it, as I have hard time distinguishing what is actual error, and what is new behavior.
  • read the disk's uuid from the first machine. That's not very handy for me, as in my case I don't know where the machine is zfs cloned from.
  • change the disk's UUID prior to read it's old value. That's not possible, as in my case I'm cloning machines with several disks attached, and I wouldn't know which disk is which when editing the *.xml later.

I just need to read the disks uuid

Thank you --

Vlad

Change History

comment:1 Changed 3 years ago by frank

This did not work in VBox 3.2 either. Once an image is registered, another image with the same UUID cannot registered as well. VBoxManage showhdinfo <file> tries to register that medium before querying the information.

comment:2 Changed 3 years ago by neuron

Hi,

I quite sure it worked on 3.2.10, but I don't have it installed anymore to test it. We use scripts to manage the cloning of virtualbox machines which didn't change.

Is there any other reliable way of telling UUID of disk image?

Thank you --

Vlad

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use