|
Unable to connect to the VMM database.
Problem Description. My teammates at work tried to delete a two-node failover cluster from Virtual Machine Manager console, and received the following errors:
The script of the thread contained delete statements to be executed on the
VMM database, statements intended to remove the node that VMM console does not
allow to remove. We added a few more delete statements to the original script to
successfully remove the other cluster node. DECLARE @HostClusterId uniqueidentifierSET @HostClusterId = (Select HostClusterId from tbl_ADHC_Host WHERE ComputerName = 'nodename.domain')DELETE WHERE [PhysicalMachineId] IN (Select [PhysicalMachineId] from tbl_ADHC_Host WHERE ComputerName = 'nodename.domain') DELETE FROM tbl_ADHC_ISCSIHbaToPortalMappingWHERE ISCSIHbaID IN (SELECT ISCSIHbaID FROM tbl_ADHC_HostInternetSCSIHba WHERE ISCSIHbaID IN (SELECT HbaID from tbl_ADHC_HostBusAdapter WHERE HostID IN (Select HostID from tbl_ADHC_Host WHERE HostClusterID = @HostClusterId))) DELETE FROM tbl_ADHC_ISCSIHbaToTargetMappingWHERE ISCSIHbaID IN (SELECT ISCSIHbaID FROM tbl_ADHC_HostInternetSCSIHba WHERE ISCSIHbaID IN (SELECT HbaID from tbl_ADHC_HostBusAdapter WHERE HostID IN (Select HostID from tbl_ADHC_Host WHERE HostClusterID = @HostClusterId))) DELETE FROM tbl_ADHC_HostInternetSCSIHbaWHERE ISCSIHbaID IN (SELECT HbaID from tbl_ADHC_HostBusAdapter WHERE HostID IN (Select HostID from tbl_ADHC_Host WHERE HostClusterID = @HostClusterId)) DELETE FROM tbl_ADHC_FCHbaToFibrePortMappingWHERE FCHbaID IN (SELECT FCHbaID FROM tbl_ADHC_HostFibreChannelHba WHERE FCHbaID IN (SELECT HbaID from tbl_ADHC_HostBusAdapter WHERE HostID IN (Select HostID from tbl_ADHC_Host WHERE HostClusterID = @HostClusterId))) DELETE FROM tbl_ADHC_HostFibreChannelHbaWHERE FCHbaID IN (SELECT HbaID from tbl_ADHC_HostBusAdapter WHERE HostID IN (Select HostID from tbl_ADHC_Host WHERE HostClusterID = @HostClusterId)) DELETE from tbl_ADHC_HostBusAdapterWHERE HostID IN (Select HostID from tbl_ADHC_Host WHERE HostClusterID = @HostClusterId) DELETE from tbl_NetMan_InstalledVirtualSwitchExtension --NO FKWHERE HostID IN (Select HostID from tbl_ADHC_Host WHERE HostClusterID = @HostClusterId) DELETE FROM dbo.tbl_ADHC_HostDiskWHERE ClusterDiskID IN (SELECT DiskID from tbl_ADHC_ClusterDisk WHERE ClusterID = @HostClusterId) DELETE from tbl_ADHC_ClusterDiskWHERE ClusterID = @HostClusterId DELETE FROM tbl_WLC_VMTemplateRelationWHERE TemplateId IN (SELECT ObjectId FROM tbl_WLC_VObject WHERE HostID IN (Select HostID FROM tbl_ADHC_Host WHERE HostClusterID = @HostClusterId)) DELETE FROM tbl_WLC_VMInstanceWHERE ObjectId IN (SELECT ObjectId FROM tbl_WLC_VObject WHERE HostID IN (Select HostID FROM tbl_ADHC_Host WHERE HostClusterID = @HostClusterId))DELETE FROM tbl_WLC_VObjectWHERE HostID IN (Select HostID FROM tbl_ADHC_Host WHERE HostClusterID = @HostClusterId) --DELETE from tbl_NetMan_HostNetworkAdapterToLogicalNetwork --WHERE HostNetworkAdapterID IN (SELECT NetworkAdapterID from tbl_ADHC_HostNetworkAdapter WHERE HostID = 'BB53CF34-452A-464E-A753-D0D42D79168E') --DELETE from tbl_NetMan_HostNetworkAdapterToIPSubnetVLan --EMPTY --WHERE HostNetworkAdapterID IN (SELECT NetworkAdapterID from tbl_ADHC_HostNetworkAdapter WHERE HostID = 'BB53CF34-452A-464E-A753-D0D42D79168E') DELETE FROM tbl_NetMan_HostNetworkAdapterToLogicalNetworkWHERE HostNetworkAdapterID IN (SELECT NetworkAdapterID from tbl_ADHC_HostNetworkAdapter WHERE HostID IN (SELECT HostID FROM tbl_ADHC_VirtualNetwork WHERE HostID IN (Select HostID FROM tbl_ADHC_Host WHERE HostClusterID = @HostClusterId))) DELETE from tbl_ADHC_HostNetworkAdapterWHERE HostID IN (SELECT HostID FROM tbl_ADHC_VirtualNetwork WHERE HostID IN (Select HostID from tbl_ADHC_Host WHERE HostClusterID = @HostClusterId))
WHERE HostID IN (Select HostID FROM tbl_ADHC_Host WHERE HostClusterID = @HostClusterId)
WHERE HostID IN (SELECT HostID from tbl_ADHC_HostWHERE HostClusterID = @HostClusterId)
WHERE HostID IN (SELECT HostID from tbl_ADHC_HostWHERE HostClusterID = @HostClusterId)DELETE from tbl_ADHC_HostWHERE HostClusterID = @HostClusterId
|
.Send mail to
webmaster@sqlcoffee.com with
questions or comments about this web site.
|