We have one SCVMM 2008 installed managing 2 3nodes Hyper-V clusters.
We noted that often, when we move one VM from one HyperV node to another using SCVMM, the jobs are reported as failed in the console even if the VM is correclty up and running on the target host.
So we'd like to know:
- if it's possible to set a sort of timeout on this operation in order to tell to SCVMM to wait a little bit more before setting the failed job status
- how to reset the job status or delete the job status entry, state that the desired operation was succesfully completed.
Hope to have clearly explaned our needs
RGDS
1. Had to download and install SQL Management Studio Express (since I was using SQL 2005 Express for the SCVMM DB)
http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796
2. After attaching to the MICROSOFT$VMM$ database, i browsed to the following and highlighted it.
Databases > VirtualManagerDB
3. Then I selected New Query
4. I used this query:
UPDATE
tbl_TR_TaskTrail SET IsVisible = 0 WHERE TaskState = 'Failed';5. Then I executed thequery (r click > execute)So, this basically keeps the failed jobs in the database, but makes it to wherethey are notvisable.
If you want to clear all jobs (make them not visable) use the following:
UPDATE tbl_TR_TaskTrail SET IsVisible = 0
NOTE: You must have SCVMM closed to be able to update the database.
- Proposed as answer by Brent Caskey, MCM Wednesday, February 18, 2009 9:22 AM
- Marked as answer by Carmen SummersMicrosoft employee Tuesday, March 24, 2009 4:32 AM
- Unmarked as answer by Carmen SummersMicrosoft employee Thursday, August 19, 2010 8:53 PM
1. Had to download and install SQL Management Studio Express (since I was using SQL 2005 Express for the SCVMM DB)
http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796
2. After attaching to the MICROSOFT$VMM$ database, i browsed to the following and highlighted it.
Databases > VirtualManagerDB
3. Then I selected New Query
4. I used this query:
UPDATE
tbl_TR_TaskTrail SET IsVisible = 0 WHERE TaskState = 'Failed';5. Then I executed thequery (r click > execute)So, this basically keeps the failed jobs in the database, but makes it to wherethey are notvisable.
If you want to clear all jobs (make them not visable) use the following:
UPDATE tbl_TR_TaskTrail SET IsVisible = 0
NOTE: You must have SCVMM closed to be able to update the database.
- Proposed as answer by Brent Caskey, MCM Wednesday, February 18, 2009 9:22 AM
- Marked as answer by Carmen SummersMicrosoft employee Tuesday, March 24, 2009 4:32 AM
- Unmarked as answer by Carmen SummersMicrosoft employee Thursday, August 19, 2010 8:53 PM
Unfortunately, this isn't exactly what is needed. It hides the failed jobs (not sure how that is useful), but does not apparently change the status of a VM to which a failed job applies. I tried doing a refresh on the host but it seems to make no difference, and there appears to be no way to refresh a failed VM.
So I still have a VM whose P2V migration job failed, but I was able to fix manually. The hosts's Hyper-V Manager is happily managing that VM, but SCVMM thinks the VM is in a failed state and won't do a thing with it.
What we really need here is a way to change the status of the VM itself, which was set as a result of a job, not a tool to hide the failed jobs.
I've done a little spelunking, and I note that the table dbo.tbl_WLC_VObject appears to list VM statuses. There are several columns that seem relevant here, including ObjectState, TaskCheckPoint, FailedJobID and a few others. It looks like I _should_ be able to change those values directly and fix the problem. But I'm chicken: the VM is in production and working fine; I'd rather not screw that up.
I might just be able to change the status (ObjectState) to 0 (I've found other references to people doing that under other circumstances in lab environments). I'm not sure what to do with the OSID field, though. It looks like a SID but, checking another VM, doesn't seem to show up in the registry.
And FWIW, I'd call this an SCVMM bug. It should be possible to refresh/clear/reset the status of VM within the SCVMM user interface. Right now, the only option within SCVMM seems to be to delete the VM altogether. Nope, not going to do that.
FWIW2, after seeing that the suggested failed job "fix" didn't help, I decided to unfix it so I can see all jobs (not a fan of information hiding), and ran: UPDATE tbl_TR_TaskTrail SET IsVisible = 1. It seemed to work fine.
If anyone has suggestions how to deal with this safely, I'm all ears.
/kenw
Thanks,
Brian
try this
VMM tricks: How to forcefully remove a Virtual Machine from the SCVMM admin console
http://fawzi.wordpress.com/2010/07/01/vmm-tricks-how-to-forcefully-remove-a-virtual-machine-from-the-scvmm-admin-console/
to remove failed VM try this...Try going into powershell interface and running the following command:
PS C:\> $VM = Get-VM -VMMServer VMMServer1.Contoso.com | where { $_.VMHost.Name -eq “VMHost01.Contoso.com” -and $_.Name -eq “VM01″ }
PS C:\> Remove-VM -VM $VM -Force
http://fawzi.wordpress.com/2010/07/01/vmm-tricks-how-to-forcefully-remove-a-virtual-machine-from-the-scvmm-admin-console/
- Proposed as answer by M FawziModerator Sunday, September 05, 2010 8:33 PM
to remove failed VM try this...Try going into powershell interface and running the following command:
PS C:\> $VM = Get-VM -VMMServer VMMServer1.Contoso.com | where { $_.VMHost.Name -eq “VMHost01.Contoso.com” -and $_.Name -eq “VM01″ }
PS C:\> Remove-VM -VM $VM -Force
http://fawzi.wordpress.com/2010/07/01/vmm-tricks-how-to-forcefully-remove-a-virtual-machine-from-the-scvmm-admin-console/
- Proposed as answer by M FawziModerator Sunday, September 05, 2010 8:33 PM
CAUTION!
Running this statement against the VMM db will cause TaskGC to no longer clean up jobs!
The command below, mentioned above, does not actually remove any jobs from the database. It merely causes them to not appear. This results in an ever increasing log of jobs that will not be correctly removed with TaskGC. One customer I worked with performed this operation and ended up with hundreds of thousands of jobs in the database. The highest number you would want is around ten thousand.
Do not use this command:
UPDATE tbl_TR_TaskTrail SET IsVisible = 0 WHERE TaskState = 'Failed';
The right way to clean up jobs:
SCVMM service may consume high memory or CPU utilization
_______________________________________________________________________
Best Regards, Jonathan Jordan [MSFT] – Posting is provided "AS IS" with no warranties, and confers no rights
_______________________________________________________________________
Thanks so much.
I've cleared several failed VMs per you pointed out.