VMware Cloud Community
marcgijsman
Contributor
Contributor

Duplicate folders in datastore??

Hi All,

Today I noticed something strange, when I look in the datastore browser I see almost duplicate folders (trailing with _1, 2). The original folder and the original1 folder contain the same VM. In the VI-client I see that the VM is using the original_1 folder.

What did I do wrong??

Thanks for your help.

Reply
0 Kudos
7 Replies
Michelle_Laveri
Virtuoso
Virtuoso

A vmfs volume has two labels - a volume label and datastore label. Volume labels must be unique to an ESX host, whereas datastore labels must unique to your virtualcenter environment.

If I have 10 servers each with local storage with labels of storage1, then as they are added to virtual center they are relabelled to be

storage1

storage1(1)

storage1(2)

storage1(3)

The volume label remains unchanged, but the datastore labelled is serialized automagically by VC as you add it into the VC. What you needs both a datastore and volume label which is globally unique such as esx1_storage1, esx2_storage1 and so on.

The correct way to change BOTH the volume label and the datastore label. Is to right-click the VMFS, choose Properties, under Volume Properties, and Datastore Name click the change button. Type your new name. If you merely right-click and relabel - you only change the volume label not the datastore label as well.

What your seeing is a "feature" of the product - rather than something you have done wrong...

Regards

Mike

Regards
Michelle Laverick
@m_laverick
http://www.michellelaverick.com
Reply
0 Kudos
marcgijsman
Contributor
Contributor

Hi Mike,

I think I did not explain it right.

When I create a new VM a folder is created on the datastore I selected with the same name as the VM containing the vmdk, vmx and log files.

I converted a VM to template and deployed new vm's (all with different names). When I browsed the datastore after a while i noticed several duplicate folders on the datastore like for example folders VM1 and VM1_1 or VM2 and VM2_1.

Any idea how this could happen??

Reply
0 Kudos
Michelle_Laveri
Virtuoso
Virtuoso

Yup... each VM created in the VMFS should be in a unique directory - I think if you try to create two VMs with the SAME name in the SAME datastore that it then serialises the name...

Additionally, when you define a VM - such as mike. The first virtual disks would be mike.vmdk, the second mike_1.vmdk and then mike_1.vmdk. So what you might be seeing is this serialization of the disk file name?

Regards

Mike

Regards
Michelle Laverick
@m_laverick
http://www.michellelaverick.com
Reply
0 Kudos
yaba
Contributor
Contributor

Hi Mike :

I would like to rename my storage1 without VI CLient because I'm doing a fresh install with kickstart. Doing

ln -sf `readlink -f /vmfs/volumes/storage1` /vmfs/volumes/$MY_STORAGE_NAME

hostd.log says

hostd-3.log:\[2007-06-20 12:56:13.308 'Hostsvc::Datastore' 21711792 info] Refresh: VMFS Datastore name was changed from 'storage1' to 'MY_STORAGE_NAME

'.

but when I list /vmfs/volumes/ I keep on seeing storage1

Reply
0 Kudos
Michelle_Laveri
Virtuoso
Virtuoso

Hi Mike :

I would like to rename my storage1 without VI CLient

because I'm doing a fresh install with kickstart.

Doing

ln -sf `readlink -f /vmfs/volumes/storage1`

/vmfs/volumes/$MY_STORAGE_NAME

hostd.log says

hostd-3.log:[2007-06-20 12:56:13.308

'Hostsvc::Datastore' 21711792 info] Refresh: VMFS

Datastore name was changed from 'storage1' to

'MY_STORAGE_NAME

'.

but when I list /vmfs/volumes/ I keep on seeing

storage1

I'm not sure it can be done from the command-line this way - as this would only change the volume name not the datastore label.

How are you handling the disk partitioning during kickstart - i assume manual partitioning - are you creating the VMFS during the kickstart part?

Is the VMFS blank? If so you could always use fdisk script to wipe the VMFS and relabel the volume - this would set the volume label and datastore label to be the same

Regards

Mike

Regards
Michelle Laverick
@m_laverick
http://www.michellelaverick.com
Reply
0 Kudos
yaba
Contributor
Contributor

Hi:

I use this lines at kickstart

clearpart linux initlabel --drives=cciss/c0d0

.

.

part None --size 126532 --grow fstype vmfs3 ondisk=cciss/c0d0

At the first install the partition will be blank.

When I do it with your instructions ( right click the VMFS from the VC ...), in hostd.log I see that /sbin/partedUtil command is invoked but I dont think this can be very helpfull.

Thanks in advanced

Reply
0 Kudos
yaba
Contributor
Contributor

Doing

ln -sf `readlink -f /vmfs/volumes/storage1` /vmfs/volumes/$HOSTNAME-vmfs

in the kickstart installation works. But when I include esx to the arquitecture ( right click - disconnect and right click - connect ) then name of my vmfs volume changes to $HOSTNAME-vmfs ( 1 ). Rename it but only rename Datastore Name, not Volume Label.

No luck in the end

Reply
0 Kudos