Specifications

Table Of Contents
VMware, Inc. 125
Chapter 6 Using Disks in a Virtual Machine
You!can!use!SCSI!reservation!to!work!around!the!lock!file!so!that!multiple!virtual!
machines!can!access!it.!This!is!typically!done!in!conjunction!with!a!highavailability!
configuration,!such!as!clustering.!For!more!information!about!this,!see!“Using!
HighAvailability!Configurations”!in!the!VMware!Server!Administration!Guide.
When!a
!virtual!machine!is!powered!off,!it!removes!the!lock!files!it!created.!If!it!cannot!
remove!the!lock,!a!stale!lock!file!is!left!protecting!the!.vmdk!file.!For!example,!if!the!host!
machine!crashes!before!the!virtual!machine!has!a!chance!to!remove!its!lock!file,!a!stale!
lock!
remains.
If!a!stale!lock!file!remains!when!the!virtual!machine!is!started!again,!the!virtual!machine!
tries!to!remove!the!stale!lock.!To!make!sure!that!no!virtual!machine!could!be!using!the!
lock!file,!the!virtual!machine!checks!the!lock!file!to!see!whether
1The!lock!was!created!on!the
!same!host!where!the!virtual!machine!is!running.!
2The!process!that!created!the!lock!is!not!running.
If!those!two!conditions!are!true,!the!virtual!machine!can!safely!remove!the!stale!lock.!If!
either!of!those!conditions!is!not!true,!a!dialog!box!appears,!warning!you!that!the!virtual!
machine!cannot
!be!powered!on.!If!you!are!sure!it!is!safe!to!do!so,!you!can!delete!the!lock!
files!manually.!On!Windows!hosts,!the!filenames!of!the!lock!files!end!in!.lck.!On!Linux!
hosts,!the!filenames!of!the!lock!files!end!in!.WRITELOCK.
Physical!disk!partitions!are!also!protected
!by!locks.!However,!the!host!operating!
system!is!not!aware!of!this!locking!convention!and!does!not!respect!it.!For!this!reason,!
VMware!strongly!recommends!that!the!physical!disk!for!a!virtual!machine!not!be!
installed!on!the!same!physical!disk!as!the!host!operating!system.
Defragmenting and Shrinking Virtual Disks
If!you!have!a!virtual!disk!that!grows!as!data!is!added,!you!can!defragment!and!shrink!
it!as!described!in!this!section.!If!you!allocated!all!the!space!for!your!virtual!disk!at!the!
time!you!created!it,!you!cannot!defragment!and!shrink!it.
Defragmenting Virtual Disks
Defragmenting!disks!rearranges!files,!programs,!and!unused!space!on!the!virtual!disk!
so!that!programs!run!faster!and!files!open!more!quickly.!Defragmenting!does!not!
reclaim!unused!space!on!a!virtual!disk.!To!reclaim!unused!space,!shrink!the!disk.