VMware Cloud Community
RoarkH
Contributor
Contributor
Jump to solution

Question about changing adapter type when cloning with vmkfstools

Hi everyone,

I seem to have found myself stuck trying to use vmkfstools -i to clone a machine, actually the command seems to work fine except that I would like to change the hard drive adapter type form "ide" to "buslogic" at the same time and that is where I am getting stuck. This is what I have tried...

vmkfstools -i </path/to/oldmachine.vmdk> </path/to/newmachine.vmdk> -a buslogic

This command is cloning my machine but when I view the newly created vmdk file the ddb.adapter type is still set to "ide" not "buslogic". It seems like the "-a buslogic" directive is being ignored, or I don't understand what it is supposed to do.

Does anyone know what I might be doing wrong?

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
continuum
Immortal
Immortal
Jump to solution

for a data-disk rewriting the line ddb.adapterType = in the vmdk-descriptor is enough.


For a boot-disk I would also rewrite the disk geometry.

I made some notes on this topic - see http://sanbarrow.com/vmdk-basics.html#changeadapter

How to change the adapter-type of an existing vmdk

A vmdk can be connected to different controllers
- IDE
- Bus-logic-controller
- LSI-logic-controller
- LSI-logic SAS-controller
- new paravirtualised SCSI-controller

In the vmdk-description this is assigned in the parameter

ddb.adapterType =


The vmdk description only understands three values : "ide" , "buslogic"        , "lsilogic"
For all the newer controllers like the LSI-SAS use "lsilogic".       
If you need to change the adapter-type of a disk that is used to boot a        guest it is recommended
to also change the disk-geometry.
If the disk is only used for data adjusting the geometry may not be necessary.       
Keep in mind that the adapter-type for a VM is also configured in the vmx-file.
So if you rewrite a IDE-disk to a SCSI-disk do not forget to also change        / check the vmx-file

ide0:0.filename = "ide-disk.vmdk"

to

scsi0.present = "true"
scsi0.virtualDev = "lsilogic"
scsi0:0.present = "true"
scsi0:0.filename = "changed-disk.vmdk"

<<<


How to calculate the disk-geometry

There are several reasons why you want to calculate the disk-geometry manually:
- change the adapter-type of an existing vmdk
- create a vmdk description for a dd-file
- create a vmdk description for a img-file like used by Starwind
- create a vmdk description for a *-flat.vmdk when the original description        is lost

For all cases we first need the nominal size of the disk in sectors.
Look up the size of the image-file in bytes.

<size of image in bytes> / 512 = <size in sectors>

Next decide which type of geometry you want : IDE or SCSI

For SCSI-disks the typical geometry is * cylinders x 255 heads x 63 sectors

ddb.geometry.cylinders = *
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"

To get the number of cylinders calculate
<size in sectors> / 16065 = <number of cylinders>
When the vmdk uses adapertype buslogic or lsilogic this formula is valid        for all disks larger than 1 Gb

For IDE-disks the typical geometry is * cylinders x 16 heads x 63 sectors

ddb.geometry.cylinders = *
ddb.geometry.heads = "16"
ddb.geometry.sectors = "63"

To get the number of cylinders calculate
<size in sectors> / 1008 = <number of cylinders>
When the vmdk uses adapertype ide the maximum value for <number of cylinders>        is 16383.
So for all disks larger than that - 8Gb - you can use this geometry

ddb.geometry.cylinders = "16383"
ddb.geometry.heads = "16"
ddb.geometry.sectors = "63"


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

View solution in original post

0 Kudos
10 Replies
a_p_
Leadership
Leadership
Jump to solution

Does anyone know what I might be doing wrong?

The good news is that you are doing nothing wrong.

According to the documentation, "The adapter type of a disk to be created. Accepts buslogic, lsilogic or ide.", so this option can only be used to create a new virtual disk. To convert a virtual disk from IDE to SCSI, take a look at e.g. http://kb.vmware.com/kb/1016192

André

continuum
Immortal
Immortal
Jump to solution

for a data-disk rewriting the line ddb.adapterType = in the vmdk-descriptor is enough.


For a boot-disk I would also rewrite the disk geometry.

I made some notes on this topic - see http://sanbarrow.com/vmdk-basics.html#changeadapter

How to change the adapter-type of an existing vmdk

A vmdk can be connected to different controllers
- IDE
- Bus-logic-controller
- LSI-logic-controller
- LSI-logic SAS-controller
- new paravirtualised SCSI-controller

In the vmdk-description this is assigned in the parameter

ddb.adapterType =


The vmdk description only understands three values : "ide" , "buslogic"        , "lsilogic"
For all the newer controllers like the LSI-SAS use "lsilogic".       
If you need to change the adapter-type of a disk that is used to boot a        guest it is recommended
to also change the disk-geometry.
If the disk is only used for data adjusting the geometry may not be necessary.       
Keep in mind that the adapter-type for a VM is also configured in the vmx-file.
So if you rewrite a IDE-disk to a SCSI-disk do not forget to also change        / check the vmx-file

ide0:0.filename = "ide-disk.vmdk"

to

scsi0.present = "true"
scsi0.virtualDev = "lsilogic"
scsi0:0.present = "true"
scsi0:0.filename = "changed-disk.vmdk"

<<<


How to calculate the disk-geometry

There are several reasons why you want to calculate the disk-geometry manually:
- change the adapter-type of an existing vmdk
- create a vmdk description for a dd-file
- create a vmdk description for a img-file like used by Starwind
- create a vmdk description for a *-flat.vmdk when the original description        is lost

For all cases we first need the nominal size of the disk in sectors.
Look up the size of the image-file in bytes.

<size of image in bytes> / 512 = <size in sectors>

Next decide which type of geometry you want : IDE or SCSI

For SCSI-disks the typical geometry is * cylinders x 255 heads x 63 sectors

ddb.geometry.cylinders = *
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"

To get the number of cylinders calculate
<size in sectors> / 16065 = <number of cylinders>
When the vmdk uses adapertype buslogic or lsilogic this formula is valid        for all disks larger than 1 Gb

For IDE-disks the typical geometry is * cylinders x 16 heads x 63 sectors

ddb.geometry.cylinders = *
ddb.geometry.heads = "16"
ddb.geometry.sectors = "63"

To get the number of cylinders calculate
<size in sectors> / 1008 = <number of cylinders>
When the vmdk uses adapertype ide the maximum value for <number of cylinders>        is 16383.
So for all disks larger than that - 8Gb - you can use this geometry

ddb.geometry.cylinders = "16383"
ddb.geometry.heads = "16"
ddb.geometry.sectors = "63"


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
RoarkH
Contributor
Contributor
Jump to solution

Thanks for your post, I guess I still have a question now about calculating the new geometry settings.

According to an ls -l the disk file for the cloned machine is 161061273600 bytes (150gb) so...

161061273600 / 512 = 314572800 Sectors

so following the instructions in your post (<size in sectors> / 16065 = <number of cylinders>) I take...

314572800 / 16065 = 19581.251167133520075

I am a little puzzled that I am getting a fractional result, should I enter 19582? Or am I missing something here?

Is the sector size always 512 bytes or is there some way to verify that as well?

Thanks very much for your help.

Roark

0 Kudos
continuum
Immortal
Immortal
Jump to solution

you already have the value for sectors as you already have a vmdk descriptor

# Disk DescriptorFile
version=1
CID=7341dd22
parentCID=ffffffff
createType="vmfs"

# Extent description
RW 16777216 VMFS "test-flat.vmdk"

# The Disk Data Base
#DDB

...

the value marked in red gives the amount of sectors

when I have to calculate a descriptor for an unknown file I round down so that would be 19581in your example


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
RoarkH
Contributor
Contributor
Jump to solution

I think I am getting closer but still seem to be having issues, I went ahead and cloned my machine using vmkfstools -i which seemed to work, I then edited the settings in the newly cloned machine's vmdk file to look like this...

ddb.geometry.cylinders = "19581"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.adapterType = "buslogic"

I then created a new custom virtual machine with a BusLogic SCSI controller and attached the disk, however when I attempt to start up windows on the clone I am getting a BSOD, I was able to snap a picture of the Stop code since it only was visible for a second or so, the message is...

*** STOP: 0x0000007b (0xBA4CB524, 0xC0000034, 0x00000000, 0x00000000)

I wonder what I might be missing now?

Again, thanks for all of your help with this.

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

I wonder what I might be missing now?

What you are missing is the Buslogic driver for the boot disk. The easiest way to load this driver to Windows is to temporarily add a second disk with the Buslogic controller to the VM before you modify the boot disk (IDE -> SCSI).

André

RoarkH
Contributor
Contributor
Jump to solution

Ok, now that you mention it that makes perfect sense, so assuming I want to work with a clone of my current machine I should go ahead and clone the machine leaving the disk adapter type at ide, then add a small SCSI disk based on the buslogic controller and make sure drivers are loaded and working for it, then shutdown the guest, make the adapter type and geometry changes to the vmdk file, then in the machine settings just remove the IDE disk and add it back as a Buslogic SCSI disk and restart the machine? I will try all of this first thing tomorrow and report back.

Again, thanks for the help.

Roark

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Exactly. After you have modified the .vmdk file follow steps 6 trough 8 from the KB article I posted earlier.

André

0 Kudos
continuum
Immortal
Immortal
Jump to solution

to fix the bluescreen - driverload problem you can also tell Converter to "configure machine" and then give Converter the path to the vmx-file


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
RoarkH
Contributor
Contributor
Jump to solution

This worked, thanks everyone for your help.

0 Kudos