Glo Networks Technical Blog (Glo Blog)

Glo Networks team sharing their technical experiences and thoughts.

Sometimes SCVMM 2008 [R2] has a problem, and it becomes out of sync with the underlying Hyper-V cluster. Usually a quick refresh of the cluster and you’re stored.

Sadly this is not always the case. In the instance where you see duplicate virtual machines you have a bit of an issue on your hands as you can’t migrate that virtual machine to the Hyper-V cluster node that also has the “missing” version of itself.

If you delve deeper, and check the Failover Cluster Manager, you should see that there is only one copy. With that verified the answer is to break out the SQL to fix SCVMM.

  1. Ideally you’ll want to stop the SCVMM service (VMMService)
  2. Download and install SQL Studio Manager, or if you’re really hardcore use osql. If you’ve used the default database then you’ll want to connect to COMPUTERNAME\MICROSOFT$VMM$. Otherwise it’ll be where ever it was installed.
  3. Now there are “2″ solutions we’ve found for this problem. As always backup your database first.
    • We found by digging into the database that the virtual machines instances are stored in tbl_WLC_VObject and have an ObjectState equal to 220. Deleting these very quickly removes the VM. However it does potentially leave other references behind.
    • The technet way, which we’d recommend, (see http://technet.microsoft.com/en-us/library/ff641854.aspx), which looks at the same table, however also searches all other tables for references.
  4. Restart the SCVMM service and you should be laughing all the way to the bank

Just incase Technet ever decides to go away, we’ve put the script from the page referenced above, below.

BEGIN TRANSACTION T1

DECLARE custom_cursor CURSOR FOR
SELECT ObjectId from
dbo.tbl_WLC_VObject WHERE [ObjectState] = 220
DECLARE @ObjectId uniqueidentifier
OPEN custom_cursor
FETCH NEXT FROM custom_cursor INTO @ObjectId
WHILE(@@fetch_status = 0)
BEGIN
DECLARE vdrive_cursor CURSOR FOR
SELECT VDriveId, VHDId, ISOId from
dbo.tbl_WLC_VDrive WHERE ParentId = @ObjectId
DECLARE @VDriveId uniqueidentifier
DECLARE @VHDId uniqueidentifier
DECLARE @ISOId uniqueidentifier

OPEN vdrive_cursor
FETCH NEXT FROM vdrive_cursor INTO @VDriveId, @VHDId, @ISOId
WHILE(@@fetch_status = 0)
BEGIN
DELETE FROM dbo.tbl_WLC_VDrive
WHERE VDriveId = @VDriveId
if(@VHDId is NOT NULL)
BEGIN

DELETE FROM dbo.tbl_WLC_VHD
WHERE VHDId = @VHDId
DELETE FROM dbo.tbl_WLC_PhysicalObject
WHERE PhysicalObjectId = @VHDId
END
if(@ISOId is NOT NULL)
BEGIN

DELETE FROM dbo.tbl_WLC_ISO
WHERE ISOId = @ISOId
DELETE FROM dbo.tbl_WLC_PhysicalObject
WHERE PhysicalObjectId = @ISOId
END

FETCH NEXT FROM vdrive_cursor INTO @VDriveId, @VHDId, @ISOId
END
CLOSE vdrive_cursor
DEALLOCATE vdrive_cursor
-----------------
DECLARE floppy_cursor CURSOR FOR
SELECT VFDId, vFloppyId from
dbo.tbl_WLC_VFloppy WHERE HWProfileId = @ObjectId
DECLARE @vFloppyId uniqueidentifier
DECLARE @vfdId uniqueidentifier
OPEN floppy_cursor
FETCH NEXT FROM floppy_cursor INTO @vfdId, @vFloppyId
WHILE(@@fetch_status = 0)
BEGIN
DELETE FROM dbo.tbl_WLC_VFloppy
WHERE VFloppyId = @vFloppyId

if(@vfdid is NOT NULL)
BEGIN
DELETE FROM dbo.tbl_WLC_VFD
WHERE VFDId = @vfdId
DELETE FROM dbo.tbl_WLC_PhysicalObject
WHERE PhysicalObjectId = @vfdId

END

FETCH NEXT FROM floppy_cursor INTO @vfdId, @vFloppyId
END
CLOSE floppy_cursor
DEALLOCATE floppy_cursor
----------------
DECLARE checkpoint_cursor CURSOR FOR
SELECT VMCheckpointId from
dbo.tbl_WLC_VMCheckpoint WHERE VMId = @ObjectId
DECLARE @vmCheckpointId uniqueidentifier
OPEN checkpoint_cursor
FETCH NEXT FROM checkpoint_cursor INTO @vmCheckpointId
WHILE(@@fetch_status = 0)
BEGIN
DELETE FROM dbo.tbl_WLC_VMCheckpointRelation
WHERE VMCheckpointId = @vmCheckpointId

FETCH NEXT FROM checkpoint_cursor INTO @vmCheckpointId
END
CLOSE checkpoint_cursor
DEALLOCATE checkpoint_cursor
-------------------------
---------Clean checkpoint
DELETE FROM dbo.tbl_WLC_VMCheckpoint
WHERE VMId = @ObjectID

exec [dbo].[prc_VMMigration_Delete_VMInfoAndLUNMappings] @ObjectId
DECLARE @RefreshId uniqueidentifier
exec [dbo].[prc_RR_Refresher_Delete] @ObjectId, @RefreshId

DELETE FROM dbo.tbl_WLC_VAdapter
WHERE HWProfileId = @ObjectId

DELETE FROM dbo.tbl_WLC_VNetworkAdapter
WHERE HWProfileId = @ObjectId

 

 

DELETE FROM dbo.tbl_WLC_VCOMPort
WHERE HWProfileId = @ObjectId
DELETE FROM dbo.tbl_WLC_HWProfile
WHERE HWProfileId = @ObjectId
DELETE FROM dbo.tbl_WLC_VMInstance
WHERE VMInstanceId = @ObjectId
DELETE FROM dbo.tbl_WLC_VObject
WHERE ObjectId = @ObjectId
FETCH NEXT FROM custom_cursor INTO @ObjectId
END
CLOSE custom_cursor
DEALLOCATE custom_cursor
COMMIT TRANSACTION T1


End of Support: Windows Vista SP1

2011 May 24 – 9:58 pm

Support for Windows Vista Service Pack 1 (SP1) ends on July 12 2011. As always this means Windows Vista SP1 will no longer receive software updates from Windows/Microsoft Update, including security updates.

If you’ve still got Vista devices deployed on your network we highly recommend that they are patched to SP2.

As always, if your devices are managed by a Windows Server Update Services (WSUS) server, you can enforce SP2 from there. If your WSUS server is running on Windows 2003 be aware that you may need to install another KB article in order for it to be picked up correctly. Full details over on Technet.


Mac Malware

2011 May 22 – 12:03 pm

As any computer platform becomes popular the number of people or organisations that want to try and trick you out of your money or data will grow – it’s just a sad fact of life. As such it’s inevitable that Malware would eventually be written for Mac OS X. Some are surprised by the fact that there has been Malware for Macs for sometime. However, they were all just prototypes and proofs of concept.

Sadly this isn’t the case any more. In the last week or so the internet has seen the first real “in-the-wild” infections occurring in any real numbers. We’re yet to have any Macs be deposited in our hands with it yet, but I rather suspect that it’s just going to a matter of time.

The particular one that’s gotten into the news is very reminiscent of those that we’ve seen in the Windows world for quite some time – a fake antivirus warning, that prompts users to download (or in the instance of some browsers just downloads) and run some executable to fix their apparent problem.

Some antivirus vendors are on the ball, and their Mac products are manageable in the same manner as their Windows counterparts. Others are not so on the ball, and perhaps are floundering behind, and I can imagine meeting rooms full of engineers and managers having heated discussions.

Should it be time to panic? Not yet, but we do urge all Mac users to be just as diligent in their browsing and general Mac-using habits. If you’re really concerned there are always antivirus products that can be used, right now; Kaspersky, and Sophos, amongst others.


Our New Private Cloud Platform

2011 May 19 – 5:23 pm

Since the birth of Glo Networks we’ve been virtualising servers and desktops. Those of us who worked together before Glo Networks was started have been virtualising since early 2003. It’s fair to say that we love virtualising stuff. Several of us virtualise our own home systems.

It saves you money on power, hardware and in some cases because of how Microsoft’s licensing works, we’ve actually reduced the number of licenses that some of our customers had to buy. In early 2007, we started hosting systems and services online – both ours and one of our very first customer’s. It could be said that we were at the forefront of “cloud computing”, mere weeks before the term was coined.

Recently we came to terms with the fact that our platform needed a good redesign. It had grown with us and our customers, but it was coming a bit unwieldy to maintain. Last month we put in our new solution – a small Hyper-V cluster, backed up by Microsoft’s DPM 2010, powered by IBM X Series x3550 M3′s, an IBM x3250 M3, an IBM DS3512 disk system, a QNAP TS-459+ and HP Procurve 2800 series switch.

We’re still migrating our services and customers to it, but boy does it make a difference. With all our hardware consolidated and updated we’re seeing more responsive, more manageable and more highly available systems.

Would we do anything different? Probably, but that’s the way we are at Glo Networks; always striving for something better and trying to push the limit available to us at that time.

If you’re interested we’ll be following this up with a more technical post about how we setup our cluster.