VMware Cloud Community
alasdair_carnie
Enthusiast
Enthusiast

ESXi 4.1 booting from USB with Local VMFS

I'm trying to delete the local VMFS partition from my ESX4i 4.1 Host. It is booting from USB. When I try to delete it using Remove-Datastore I get the error

Remove-Datastore : 18/08/2010 17:38:29 Remove-Datastore The resource '4c6bf755-bd5c9

ef2-1ae3-001f2906da64' is in use.

At line:1 char:17

+ Remove-Datastore <<<< -Datastore Local01 -Confirm:$false

+ CategoryInfo : NotSpecified: (Smiley Happy , ResourceInUse

+ FullyQualifiedErrorId : Client20_MoServiceImpl_Invoke_ViError,VMware.VimAutomation.ViCo

re.Cmdlets.Commands.RemoveDatastore

I tried removing it using the vSphere Client and got the same error. I powered down all VMs so there are no VMs running from the local VMFS.

I tried deleting the .locker folder but I still cannot delete the datastore, but instead get the following error.

Remove-Datastore : 18/08/2010 18:04:26 Remove-Datastore An error occurred during hos

t configuration.

At line:1 char:17

+ Remove-Datastore <<<< -Datastore Local01 -Confirm:$false

+ CategoryInfo : NotSpecified: (Smiley Happy , PlatformConfigFault

+ FullyQualifiedErrorId : Client20_MoServiceImpl_Invoke_ViError,VMware.VimAutomation.ViCo

re.Cmdlets.Commands.RemoveDatastore

This is driving me nuts. Can anyone point me in the right direction?

Tags (2)
0 Kudos
17 Replies
LucD
Leadership
Leadership

Out of curiosity, what does this do ?

Make sure you are connected (COnnect-VIServer) to the ESXi host.

$ds = Get-VMHost | Get-Datastore | Get-View
$ds.DestroyDatastore()

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
alasdair_carnie
Enthusiast
Enthusiast

Hi Luc,

I get this

Exception calling "DestroyDatastore" with "0" argument(s): "The resource '4c6bf755-bd5c9ef2-1ae3-001f2906da64' is in use."

At line:1 char:21

+ $ds.DestroyDatastore <<<< ()

+ CategoryInfo : NotSpecified: (Smiley Happy [], MethodInvocationException

+ FullyQualifiedErrorId : DotNetMethodException

Al..............

0 Kudos
Dave_Mishchenko
Immortal
Immortal

So do you still have VMs registered on that datastore? Any ISO images on the ds that might be in use by a VM?




Dave

VMware Communities User Moderator

Now available - vSphere Quick Start Guide

Do you have a system or PCI card working with VMDirectPath? Submit your specs to the Unofficial VMDirectPath HCL.

0 Kudos
LucD
Leadership
Leadership

When you browse that datastore, do you see a folder or file with that name ?

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
alasdair_carnie
Enthusiast
Enthusiast

No. There is nothing active. I did have vms on there but I shut them down first. When I got the in use message, I unregistered them, and when that didn't work, I deleted them from disk.

When that didn't work I started banging my head on my desk Smiley Happy

Sent from my iPhone

0 Kudos
RParker
Immortal
Immortal

When that didn't work I started banging my head on my desk

Did you hurt the desk? Replacement cost for furniture is more than brain cells.. next time try a hammer, it's more efficient

0 Kudos
LucD
Leadership
Leadership

Dave already mentioned some of these, but perhaps run through the checklist of KB1015791

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
alasdair_carnie
Enthusiast
Enthusiast

Nope. There is a .locker folder with a messages log and a couple of other empty folders.

Sent from my iPhone

0 Kudos
alasdair_carnie
Enthusiast
Enthusiast

Sadly the desk remained stubbornly intact. As I'm on the road at the moment the best I can manage is a tyre iron. The hotel doesn't lend hammers to guests Smiley Happy

Sent from my iPhone

0 Kudos
alasdair_carnie
Enthusiast
Enthusiast

The server was a fresh install onto which I created several VMs on the local store. I shut them down and removed them from the inventory. The ISOs and Templates I use are stored on a separate NFS datastore.

Sent from my iPhone

0 Kudos
DSTAVERT
Immortal
Immortal

Did you add the scratch folder redirected to the datastore.

-- David -- VMware Communities Moderator
0 Kudos
alasdair_carnie
Enthusiast
Enthusiast

If I manually delete the .locker folder and run the script again I get a different error

Exception calling "DestroyDatastore" with "0" argument(s): "vim.fault.PlatformConfigFault"

At line:2 char:21

+ $ds.DestroyDatastore <<<< ()

+ CategoryInfo : NotSpecified: (Smiley Happy [], MethodInvocationException

+ FullyQualifiedErrorId : DotNetMethodException

Alasdair Carnie

Principal Technologist

QA – transforming performance through learning

Witan Court, 294 Witan Gate West, Milton Keynes, Bucks, MK9 1EJ

Tel +44 (0) 1908 206700

Email alasdair.carnie@qa.com

Web www.qa.com

0 Kudos
DSTAVERT
Immortal
Immortal

Nope. There is a .locker folder with a messages log and a couple of other empty folders.

The problem is that the ESXi syslog destination folder is on the datastore. You may also have the scratch folder redirected as well.

-- David -- VMware Communities Moderator
0 Kudos
alasdair_carnie
Enthusiast
Enthusiast

The scratch partition would have been created when I installed ESXi to the USB fob. If I pull the local disk and then re-install ESXi that will consume some extra RAM, but avoid the scratch partition.

Is there an easy way to re-direct the scratch partition and the log files elsewhere? I guess that is a question for a different forum, unless there is a way to do it with powershell of course...

0 Kudos
DSTAVERT
Immortal
Immortal

By default they are written to RAM disk.

-- David -- VMware Communities Moderator
0 Kudos
DSTAVERT
Immortal
Immortal

From the configuration tab Software -> Advanced Settings. Delete the textbox content for ScratchConfig and Syslog (just leave them empty) It should take effect immediately. You should point them to some location after you have reconfigured.

-- David -- VMware Communities Moderator
0 Kudos
continuum
Immortal
Immortal

I'm trying to delete the local VMFS partition from my ESX4i 4.1 Host.

the hammer method will work always : boot into Knoppix and delete the partition with the fc-ID




_________________________

VMX-parameters- WS FAQ -[ MOAcd|http://sanbarrow.com/moa241.html] - VMDK-Handbook

You also find me in the support crew of PHD Virtual Backup


________________________________________________
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