VBoxManage clonehd ... --existing

This is for discussing general topics about how to use VirtualBox.
Post Reply
saberman
Posts: 292
Joined: 21. Dec 2009, 00:32
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, 7, 8.1, 10

VBoxManage clonehd ... --existing

Post by saberman »

The manual describes the effect of the --existing option as:
existing Perform the clone operation to an already existing destination medium. Only the portion
of the source medium which fits into the destination medium is copied. This means
if the destination medium is smaller than the source only a part of it is copied, and if the
destination medium is larger than the source the remaining part of the destination medium
is unchanged.

Is the size of the target medium used to determine how much is copied the physical size or the logical size. That is, if the target medium is a dynamic vdi that is physically 40GB in size and has a maximum size of 60GB what would happen if a dynamic vdi with a physical size of 50GB and a logical size of 55GB were to be cloned into the exisiting target using the --existing option? Would the target be expanded to 50GB and all 50GB copied or would only the first 40GB be copied? Would the maximum size of the target medium after the copy still be 60GB or would it be 55GB? Would a new uuid be generated and inserted into the target medium or would it still have the uuid it had before the clonehd process was run?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage clonehd ... --existing

Post by mpack »

Think about why this constraint exists and you answer your own question.
saberman
Posts: 292
Joined: 21. Dec 2009, 00:32
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, 7, 8.1, 10

Re: VBoxManage clonehd ... --existing

Post by saberman »

mpack wrote:Think about why this constraint exists and you answer your own question.
Which constraint?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage clonehd ... --existing

Post by mpack »

saberman wrote:
mpack wrote:Think about why this constraint exists and you answer your own question.
Which constraint?
Eh? How about the one you quoted from the manual and then asked about?

Never mind, lets cut to the chase. If you use any disk imaging tool then it has the same constraint: if the two drives involved in the copy have different sizes then the smaller drive dictates the max copy size.
saberman
Posts: 292
Joined: 21. Dec 2009, 00:32
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, 7, 8.1, 10

Re: VBoxManage clonehd ... --existing

Post by saberman »

mpack wrote:Never mind, lets cut to the chase. If you use any disk imaging tool then it has the same constraint: if the two drives involved in the copy have different sizes then the smaller drive dictates the max copy size.
That does not address the specific examples I posed. Nor does it address the question of how the special data structures are handled.

Is a target drive that is physically smaller than the source but logically bigger the smaller or the bigger of the two drives?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage clonehd ... --existing

Post by mpack »

I did not address your scenarios because they are irrelevant. The constraint you quoted from the user manual is caused by drive size differences as I just explained. The current sizes of certain host files... has no bearing. It is the drive sizes which matter.

I did miss your question about whether the target UUID changes. It does not, otherwise there would be no practical difference compared to normal clonehd operation.
Post Reply