Thinking Out Loud

May 1, 2019

VitualBox Cannot register the hard disk because a hard disk with UUID already exists

Filed under: Uncategorized — mdinh @ 1:03 pm

Here’s an issue I have faced multiple times and have finally able to find a reasonable resolution.

For the moment, it seems to be working and only time will tell as other predominant solutions on WWW did not work for me.

VBox version:

D:\VirtualBox>VBoxManage -version
6.0.4r128413

D:\VirtualBox>

Start VM failed after shutdown:

[oracle@racnode-dc2-1 dbca]$ logout
[vagrant@racnode-dc2-1 ~]$ logout
Connection to 127.0.0.1 closed.

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant halt

==> racnode-dc2-1: Attempting graceful shutdown of VM...
==> racnode-dc2-1: Forcing shutdown of VM...
==> racnode-dc2-2: Unpausing the VM...
==> racnode-dc2-2: Attempting graceful shutdown of VM...
==> racnode-dc2-2: Forcing shutdown of VM...

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant up
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["showvminfo", "1d72cea4-f728-44d4-b69e-b2dd45064969"]

Stderr: VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant status
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["showvminfo", "1d72cea4-f728-44d4-b69e-b2dd45064969"]

Stderr: VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ 

VBoxManage internalcommands sethduuid / clonevdi failed: UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists

D:\VirtualBox>VBoxManage.exe internalcommands sethduuid "D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk"
VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35
-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox

D:\VirtualBox>VBoxManage clonevdi "D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk" "D:\VirtualBoxVM\vbox-rac-dc
2\racnode-dc2-2\packer-ol75-disk002.vmdk"
VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35
-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c
748d54e-3cd2-4087-82dd-65324f4365f7} already exists
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox

D:\VirtualBox>

Check UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} exists in VirtualBox.xml and VirtualBox.xml-prev:

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$ grep c748d54e-3cd2-4087-82dd-65324f4365f7 *
VBoxSVC.log:00:00:00.390000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.1:00:00:00.376400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.2:00:00:00.391000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.3:00:00:00.390000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.4:00:00:00.374400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.5:00:00:00.374400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.6:00:00:00.436800          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0

Entry Removed from VirtualBox.xml
------------------------------------------------------------------------------------------------------------------------
VirtualBox.xml:        <HardDisk uuid="{c748d54e-3cd2-4087-82dd-65324f4365f7}" location="D:/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2/packer-ol75-disk001.vmdk" format="VMDK" type="Normal">
------------------------------------------------------------------------------------------------------------------------

VirtualBox.xml-prev:        <HardDisk uuid="{c748d54e-3cd2-4087-82dd-65324f4365f7}" location="D:/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2/packer-ol75-disk001.vmdk" format="VMDK" type="Normal">

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$

Remove entry from VirtualBox.xml:

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$ grep c748d54e-3cd2-4087-82dd-65324f4365f7 *
VBoxSVC.log.2:00:00:00.391000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.3:00:00:00.390000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.4:00:00:00.376400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.5:00:00:00.391000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.6:00:00:00.390000          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.7:00:00:00.374400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.8:00:00:00.374400          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0
VBoxSVC.log.9:00:00:00.436800          ERROR [COM]: aRC=E_INVALIDARG (0x80070057) aIID={d0a0163f-e254-4e5b-a1f2-011cf991c38d} aComponent={VirtualBoxWrap} aText={Cannot register the hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' {b507fc35-1c3c-46ab-9e0e-91f192c5b935} because a hard disk 'D:\VirtualBoxVM\vbox-rac-dc2\racnode-dc2-2\packer-ol75-disk001.vmdk' with UUID {c748d54e-3cd2-4087-82dd-65324f4365f7} already exists}, preserve=false aResultDetail=0

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$

Start VM:

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant up
Bringing machine 'racnode-dc2-2' up with 'virtualbox' provider...
Bringing machine 'racnode-dc2-1' up with 'virtualbox' provider...

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant status
Current machine states:

racnode-dc2-2             running (virtualbox)
racnode-dc2-1             running (virtualbox)

This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.

dinh@CMWPHV1 MINGW64 /d/Vagrant2/vagrant-vbox-rac (master)
$ vagrant ssh racnode-dc2-1
Last login: Wed May  1 14:40:57 2019 from 192.168.7.100

----------------------------------------
Welcome to racnode-dc2-1
OracleLinux 7.5 x86_64

FQDN: racnode-dc2-1.internal.lab
IP's:
enp0s3: 10.0.2.15
enp0s8: 192.168.7.100
enp0s9: 172.16.7.10

Processor: Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
#CPU's:    2
Memory:    5708 MB
Kernel:    4.1.12-112.16.4.el7uek.x86_64

----------------------------------------
[vagrant@racnode-dc2-1 ~]$ sudo su - oracle
Last login: Wed May  1 14:42:47 CEST 2019
[oracle@racnode-dc2-1 ~]$ . /media/patch/gi.env
The Oracle base has been set to /u01/app/oracle
ORACLE_SID=+ASM1
ORACLE_BASE=/u01/app/oracle
GRID_HOME=/u01/app/12.2.0.1/grid
ORACLE_HOME=/u01/app/12.2.0.1/grid
Oracle Instance alive for sid "+ASM1"
[oracle@racnode-dc2-1 ~]$
[oracle@racnode-dc2-1 ~]$ ps -ef|grep [p]mon
oracle   17637     1  0 14:42 ?        00:00:00 asm_pmon_+ASM1
oracle   17987     1  0 14:43 ?        00:00:00 ora_pmon_hawk1
[oracle@racnode-dc2-1 ~]$ ssh racnode-dc2-2
Last login: Wed May  1 14:42:24 2019

----------------------------------------
Welcome to racnode-dc2-2
OracleLinux 7.5 x86_64

FQDN: racnode-dc2-2.internal.lab
IP's:
enp0s3: 10.0.2.15
enp0s8: 192.168.7.101
enp0s9: 172.16.7.11

Processor: Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
#CPU's:    2
Memory:    5708 MB
Kernel:    4.1.12-112.16.4.el7uek.x86_64

----------------------------------------
[oracle@racnode-dc2-2 ~]$ ps -ef|grep pmon
oracle   16172     1  0 14:41 ?        00:00:00 asm_pmon_+ASM2
oracle   17229     1  0 14:41 ?        00:00:00 mdb_pmon_-MGMTDB
oracle   17368     1  0 14:41 ?        00:00:00 ora_pmon_hawk2
oracle   25901 25533  0 14:46 pts/0    00:00:00 grep --color=auto pmon
[oracle@racnode-dc2-2 ~]$

Check packer-ol75-disk001.vmdk from VirtualBox.xml:

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$ grep packer-ol75-disk001.vmdk VirtualBox.xml
        <HardDisk uuid="{b507fc35-1c3c-46ab-9e0e-91f192c5b935}" location="D:/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2/packer-ol75-disk001.vmdk" format="VMDK" type="Normal"/>
        <HardDisk uuid="{1e5667ab-69a7-49fc-aa76-7b6249aba862}" location="D:/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-1/packer-ol75-disk001.vmdk" format="VMDK" type="Normal"/>

dinh@CMWPHV1 MINGW64 ~/.VirtualBox
$

Before and after:

dinh@CMWPHV1 MINGW64 /d/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2
$ ll
total 4566352
drwxr-xr-x 1 dinh 197121          0 Apr 30 20:04 Logs/
-rw-r--r-- 1 dinh 197121 4675928064 May  1 07:54 opacker-ol75-disk001.vmdk
-rw-r--r-- 1 dinh 197121       6433 May  1 07:54 racnode-dc2-2.vbox
-rw-r--r-- 1 dinh 197121       6433 Apr 30 20:04 racnode-dc2-2.vbox-prev

dinh@CMWPHV1 MINGW64 /d/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2
$ ll
total 4768592
drwxr-xr-x 1 dinh 197121          0 May  1 08:38 Logs/
-rw-r--r-- 1 dinh 197121 4883021824 May  1 08:43 packer-ol75-disk001.vmdk
-rw-r--r-- 1 dinh 197121       6433 May  1 08:38 racnode-dc2-2.vbox
-rw-r--r-- 1 dinh 197121       6433 May  1 08:38 racnode-dc2-2.vbox-prev

dinh@CMWPHV1 MINGW64 /d/VirtualBoxVM/vbox-rac-dc2/racnode-dc2-2
$
Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

%d bloggers like this: