Remove-VM Error (402)
Don't ask how I got here, but after an aborted effort to create a Template from an existing VM, I have a VM in the list of SCVMM 2008 Beta 2 that doesn't even have any files left associated with it on the Hyper-V server, but it wont let me remove it.
When I try to remove it from SCVMM, the failure note I get from the Remove-VM job is:
Error (402)
Library server is not associated with this Virtual Machine Manager server.
Recommended Action
Check the library server name, and try the operation again.
Is there some way to for SCVMM to remove this entry from the list?
Respuestas
You can use PowerShell to find what LibraryServer the VM is assigned to:
$VM = Get-VM –Name “ABC123-VM”
$VM.LibraryServer
My guess is that the LibraryServer property will be null. I think you may have hit one of our known beta bugs where the LibraryServer property on the VM was not correctly set.
You may want to try Matthew's suggestion in the reply above to get rid of it.
Todas las respuestas
Hi,
I had a similar problem on SCVMM 2007 with VS. I ended up recreating the VM on the VS website. Then using VMM to delete it. For you I would recommend creating a new VM with the same name using the Hyper-V Manager, then once VMM detects that it is back delete it using VMM.
I don't like that error though. Have you check all of your agent statuses to ensure that everything is responding?
-matt
Have you tried removing it using PowerShell and the -FORCE parameter? Sort of like this:
Get-VMMServer -ComputerName localhost
$VM = Get-VM -Name "ABC123-VM"
Remove-VM -VM $VM -Force
Just tried that, got the same error:
Remove-VM : Library server is not associated with this Virtual Machine Manager server. (Error ID: 402)
Check the library server name, and try the operation again.
Any other ideas?
In response to the previous post, this is just a sandbox environment and so will be rebuilt for the final prod implementation and I guess it it beta code, but it would be nice to work out what is going wrong.
Cheers,
Jeremy.
- If you navigate to the Administration Wonderbar in the Admin Console, then select Managed Computers. What do you see for the status of your Library Server which holds the VM?
It shows as "Responding".
The non-existent VM I am trying to remove is on the same box that is my library server is on.
You can use PowerShell to find what LibraryServer the VM is assigned to:
$VM = Get-VM –Name “ABC123-VM”
$VM.LibraryServer
My guess is that the LibraryServer property will be null. I think you may have hit one of our known beta bugs where the LibraryServer property on the VM was not correctly set.
You may want to try Matthew's suggestion in the reply above to get rid of it.
- Correct. It returns nothing. Is there a way to set this property?
- No. Sorry.
Yeah I tried
$VM.LibraryServer='hostanme"
and it said it was a read-only property.
I'm also seeing this issue in SCVMM 2008 RTM.
I manually moved my default VMM library share to a new 'larger' volume. Didn't realise you have to refresh the library via the UI or powershell for this to take effect.
When i tried to create a new template, the job fails at "sysprep virtual machine" with the following error:
Error (2912)
An internal error has occurred trying to contact an agent on the MGT05.mydom.local server.
(Element not found (0x80070490))
Recommended Action
Ensure the agent is installed and running. Ensure the WS-Management service is installed and running, then restart the agent.
Now whenever i try to remove the VM (and by force using powershell) I get the Remove-VM 402 error.
I've checked the properties of the VM through powershell and there is no value for 'LibraryServer'.
Is there no other way to forcibly remove the VM from VMM?
- In the end I just blew away an rebuilt my VMM server and DB (since I wanted to go from beta to pre-RC anyway). Not a very useful suggestion, but since VMM doesn't actually hold any volatile data it is always an option as a last resort.
Cheers,
Jeremy (formerly known as Anony9mous999) Hello
I had the same problem and found a solution that worked for me:
1. go into the VMM database to the table tbl_WLC_VObject, and change the ObjectState field of the problem VM, which problably has the value 104, to value 1
update dbo.tbl_WLC_VObject
set ObjectState = 1
where Name = '<VM name>'
2. in VMM admin console, you're VM will now have the status missing, now just delete the VM and it's gone
- Propuesto como respuestasmurfphy1 lunes, 09 de marzo de 2009 5:26
- Hello,
I just wanted to mentioned that the solution Stijn suggested above corrected my problem i had like this.
1. go into the VMM database to the table tbl_WLC_VObject, and change the ObjectState field of the problem VM, which problably has the value 104, to value 1
** At this point, i went direct to the table and edit the value manually. Of course i did this because this i a Lab environment.
update dbo.tbl_WLC_VObject
set ObjectState = 1
where Name = '<VM name>'2. in VMM admin console, you're VM will now have the status missing, now just delete the VM and it's gone.
- Richard
Richard Dixon MSFT Sr Systems Engineer - Hi all,
I had very similar problems, my scvmm server rebooted whilst in the middle of creating a VM, which left my VM with an error of "creation failed" but when I tried to delete it I got an error (see below). Tried a few solutions, but the one that worked for me was using Richard's solution above. Thanks all.
Steve.
Error
(801)VMM cannot find VM object .
Recommended Action
Ensure the library object is valid, and then try the operation again.

