如何重新安装 Virtual Machine Manager 2012 R2 UR8 或更高版本

摘要

如果您具有 Microsoft System Center 2012 R2 Virtual Machine Manager (VMM 2012 R2) 安装,重新安装 VMM 更新汇总 8 或更高版本的更新将失败。 此外,您会收到下面的错误消息,并且您需要重新安装 VMM:

时间: InnerException.Type: System.Data.SqlClient.SqlException、 InnerException.Message: 冲突的 PRIMARY KEY 约束 PK_tbl_WLC_ServiceTemplate。 无法在对象 'dbo.tbl_WLC_ServiceTemplate' 中插入重复键。 重复的键值是 < key_value >。

重新安装 Virtual Machine Manager

请按照下列步骤操作:

  1. 卸载 Virtual Machine Manager。 选择保留数据库选项。

  2. 打开 SQL 管理 Studio,然后连接到保留数据库。

  3. 运行下列存储的过程: /****** Object: StoredProcedure [dbo].[prc_WLC_GetVNetworkAdapterByNicId] Script Date: 12/16/2015 2:13:12 AM ******/ -- ========================================================= -- Create date: 08/31/2007 -- Description: Get VNetworkAdapter for a given NicId -- ========================================================= ALTER PROCEDURE [dbo].[prc_WLC_GetVNetworkAdapterByNicId] @VNicId uniqueidentifier AS BEGIN DECLARE @error int SET @error = 0 SET NOCOUNT ON; SELECT [Name], [Description], [OwnerIdentifier], [CreationTime], vna.[ModifiedTime], [Accessibility], [ObjectState], [VNicId], [HWProfileId], [ParentType], [VirtualNetwork], [MACAddressType], [MACAddress], [IPv4AddressType], [IPv6AddressType], [PortId], [DeviceId], [NetworkAdapterType], [VMSubnetId], [VMNetworkId], [PortClassificationId], [PortProfileSetId], [VLanEnabled], [VLanId], [VmwAdapterIndex], [VmwPortGroup], [SlotId], [MACSpoofingEnabled], [EnableGuestIPNetworkVirtualizationUpdates], [VMNetworkOptimizationEnabled], [HostId], [LogicalSwitchId], [NetworkKBytesReadTieredPerfCounterID], [NetworkKBytesWriteTieredPerfCounterID], [VMNetworkServiceSetting], [UsesSriov], [IsUsedForHostManagement], [IPv4Addresses], [IPv6Addresses], [DefaultGateways], [DNSServers], [TemplateNicName], compliance.PortClassificationComplianceErrors AS [PortClassificationComplianceErrors], compliance.VMNetworkComplianceErrors AS [VMNetworkComplianceErrors] FROM dbo.tbl_WLC_VNetworkAdapter vna LEFT JOIN dbo.tbl_NetMan_VirtualNetworkAdapterCompliance compliance ON vna.VNicId = compliance.VirtualNetworkAdapterId WHERE VNicId = @VNicId SET @error = @@ERROR SET NOCOUNT OFF RETURN @error END IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[prc_RBS_UserRole_Add]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) SET NOEXEC OFF ELSE SET NOEXEC ON GO /****** Object: StoredProcedure [dbo].[prc_RBS_UserRole_Add] Script Date: 10/03/2007 12:13:45 ******/ ALTER PROCEDURE [dbo].[prc_RBS_UserRole_Add] ( @RoleID uniqueidentifier, @ProfileType tinyint, @Description nvarchar(2048), @Name nvarchar(256), @OwnerIdentifier nvarchar(256), @ParentUserRole uniqueidentifier, @LastUpdatedTimestamp datetime, @ShowPROTips bit, @VMNetworkMaximum smallint, @VMNetworkMaximumPerUser smallint, @VPNConnectionMaximum smallint, @VPNConnectionMaximumPerUser smallint, @VMNetworkVPNMaximumBandwidthInKbps bigint, @VMNetworkVPNMaximumBandwidthOutKbps bigint, @NATConnectionMaximum smallint = NULL, @NATConnectionMaximumPerUser smallint = NULL ) AS BEGIN TRAN SET NOCOUNT ON DECLARE @error int DECLARE @IsDuplicateName bit DECLARE @IsRoleAlreadyPresent bit SELECT @IsDuplicateName = [dbo].[fn_RBS_UserRole_NameExists](@RoleID, @ParentUserRole, @Name) -- This is especially used in Upgrade scenarios where we are inserting Administrator role SELECT @IsRoleAlreadyPresent = Count(RoleID) FROM [dbo].[tbl_RBS_UserRole] WHERE RoleID = @RoleID IF (@IsDuplicateName = 0 AND @IsRoleAlreadyPresent = 0) BEGIN INSERT INTO [dbo].[tbl_RBS_UserRole] ([RoleID] ,[ProfileType] ,[Description] ,[Name] ,[OwnerIdentifier] ,[ParentUserRole] ,[LastUpdatedTimestamp] ,[ShowPROTips] ,[VMNetworkMaximum] ,[VMNetworkMaximumPerUser] ,[VPNConnectionMaximum] ,[VPNConnectionMaximumPerUser] ,[VMNetworkVPNMaximumBandwidthInKbps] ,[VMNetworkVPNMaximumBandwidthOutKbps] ,[NATConnectionMaximum] ,[NATConnectionMaximumPerUser] ) VALUES ( @RoleID, @ProfileType, @Description, @Name, @OwnerIdentifier, @ParentUserRole, @LastUpdatedTimestamp, @ShowPROTips, @VMNetworkMaximum, @VMNetworkMaximumPerUser, @VPNConnectionMaximum, @VPNConnectionMaximumPerUser, @VMNetworkVPNMaximumBandwidthInKbps, @VMNetworkVPNMaximumBandwidthOutKbps, @NATConnectionMaximum, @NATConnectionMaximumPerUser ) -- Insert flattened tree of the hierarchy for this user role INSERT INTO [dbo].[tbl_RBS_UserRoleHierarchy] SELECT RoleId, ParentRoleId, hl FROM view_RBS_UserRoleParentChildRelation ur where ur.RoleID = @RoleID SELECT @error = @@ERROR END ELSE BEGIN SET @error = 50008 END SET NOCOUNT OFF COMMIT TRAN RETURN @error Go SET NOEXEC OFF -------------------------------------------------------------------------------------------- IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[prc_RBS_UserRole_CommonUpdate]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) SET NOEXEC OFF ELSE SET NOEXEC ON GO /****** Object: StoredProcedure [dbo].[prc_RBS_UserRole_CommonUpdate] Script Date: 10/03/2007 12:13:45 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[prc_RBS_UserRole_CommonUpdate] ( @RoleID uniqueidentifier, @Description nvarchar(2048), @OwnerIdentifier nvarchar(256), @Name nvarchar(256), @LastUpdatedTimestamp datetime, @ShowPROTips bit, @VMNetworkMaximum smallint, @VMNetworkMaximumPerUser smallint, @VPNConnectionMaximum smallint, @VPNConnectionMaximumPerUser smallint, @VMNetworkVPNMaximumBandwidthInKbps bigint, @VMNetworkVPNMaximumBandwidthOutKbps bigint, @NATConnectionMaximum smallint = NULL, @NATConnectionMaximumPerUser smallint = NULL ) AS SET NOCOUNT ON DECLARE @error int DECLARE @ParentUserRole uniqueidentifier DECLARE @IsDuplicateName bit DECLARE @OldName nvarchar(256) SELECT @ParentUserRole = [ParentUserRole], @OldName = [Name] FROM [dbo].[tbl_RBS_UserRole] WHERE [RoleID] = @RoleID IF (@OldName = @Name) BEGIN -- We are not changing role name. This is necessary if Admin has already an SSU1 and TA created SSU1, we should not error out here SELECT @IsDuplicateName = 0 END ELSE BEGIN SELECT @IsDuplicateName = [dbo].[fn_RBS_UserRole_NameExists](@RoleID, @ParentUserRole, @Name) END IF (@IsDuplicateName = 0) BEGIN UPDATE [dbo].[tbl_RBS_UserRole] SET [Description] = @Description, [OwnerIdentifier] = @OwnerIdentifier, [Name] = @Name, [LastUpdatedTimestamp] = @LastUpdatedTimestamp, [ShowPROTips] = @ShowPROTips, [VMNetworkMaximum] = @VMNetworkMaximum, [VMNetworkMaximumPerUser] = @VMNetworkMaximumPerUser, [VPNConnectionMaximum] = @VPNConnectionMaximum, [VPNConnectionMaximumPerUser] = @VPNConnectionMaximumPerUser, [VMNetworkVPNMaximumBandwidthInKbps] = @VMNetworkVPNMaximumBandwidthInKbps, [VMNetworkVPNMaximumBandwidthOutKbps] = @VMNetworkVPNMaximumBandwidthOutKbps, [NATConnectionMaximum] = @NATConnectionMaximum, [NATConnectionMaximumPerUser] = @NATConnectionMaximumPerUser WHERE [RoleID] = @RoleID SELECT @error = @@ERROR END ELSE BEGIN SET @error = 50008 END SET NOCOUNT OFF RETURN @error GO SET NOEXEC OFF

  4. 从原始安装媒体中安装 VMM 2012 R2。 在某些情况下,VMM 服务可能无法正常启动。 但是,这种行为可以忽略在此处。

  5. VMM 2012 R2 以前安装的版本应用更新汇总 (如更新汇总 7 或 8) 相对应。 这是必需的数据库才能正常工作。 如果您要更新的发行版本为 UR7 或 UR8 UR,可以直接向该样式的 UR 更新。 不需要安装 UR7 或 UR8。 例如,您可以安装发行版升级到 UR14,直接,然后运行在步骤 6 中的第二个脚本。

  6. 使用 SQL 管理 Studio 对 VMM 数据库运行以下存储的过程: /****** Object: StoredProcedure [dbo].[prc_WLC_GetVNetworkAdapterByNicId] Script Date: 12/16/2015 2:13:12 AM ******/ -- ========================================================= -- Create date: 08/31/2007 -- Description: Get VNetworkAdapter for a given NicId -- ========================================================= ALTER PROCEDURE [dbo].[prc_WLC_GetVNetworkAdapterByNicId] @VNicId uniqueidentifier AS BEGIN DECLARE @error int SET @error = 0 SET NOCOUNT ON; SELECT [Name], [Description], [OwnerIdentifier], [CreationTime], vna.[ModifiedTime], [Accessibility], [ObjectState], [VNicId], [HWProfileId], [ParentType], [VirtualNetwork], [MACAddressType], [MACAddress], [IPv4AddressType], [IPv6AddressType], [PortId], [DeviceId], [NetworkAdapterType], [VMSubnetId], [VMNetworkId], [PortClassificationId], [PortProfileSetId], [VLanEnabled], [VLanId], [VmwAdapterIndex], [VmwPortGroup], [SlotId], [MACSpoofingEnabled], [EnableGuestIPNetworkVirtualizationUpdates], [VMNetworkOptimizationEnabled], [HostId], [LogicalSwitchId], [NetworkKBytesReadTieredPerfCounterID], [NetworkKBytesWriteTieredPerfCounterID], [VMNetworkServiceSetting], [UsesSriov], [IsUsedForHostManagement], [IPv4Addresses], [IPv6Addresses], [DefaultGateways], [DNSServers], [TemplateNicName], compliance.PortClassificationComplianceErrors AS [PortClassificationComplianceErrors], compliance.VMNetworkComplianceErrors AS [VMNetworkComplianceErrors], [AccessControlListID], compliance.NetworkAccessControlListComplianceErrors AS [NetworkAccessControlListComplianceErrors] FROM dbo.tbl_WLC_VNetworkAdapter vna LEFT JOIN dbo.tbl_NetMan_VirtualNetworkAdapterCompliance compliance ON vna.VNicId = compliance.VirtualNetworkAdapterId WHERE VNicId = @VNicId SET @error = @@ERROR SET NOCOUNT OFF RETURN @error END GO

  7. 重新启动 VMM 2012 R2 服务器,并确保 VMM 服务成功启动。

重新安装高度可用 Virtual Machine Manager (HAVMM)

为此,请按照下列步骤操作:

  1. 卸载 SCVMM 管理服务器。 执行此操作时,请选择保留数据库选项 HAVMM 的所有节点上。

  2. 打开 SQL 管理 Studio 中,然后再连接到该保留的 VMM 数据库。

  3. 在 VMM 数据库中,在重新安装 Virtual Machine Manager一节的步骤 3 中运行该脚本。

  4. 在第一个 HAVMM 节点上,请执行以下步骤:

    1. 通过选择现有的数据库,从原始安装媒体中安装 VMM 2012 R2。 注意:在某些情况下,VMM 服务可能无法正常启动。 但是,您现在可以安全地忽略此行为。

    2. 将最新应用是以前的更新汇总之前卸载 VMM 服务器安装 (UR8 或更高版本)。

  5. 在运行重新安装 Virtual Machine Manager部分的步骤 6 中安装后脚本的 VMM 数据库。

  6. 重复步骤 4 和 5 的其余的 HAVMM 节点重新安装 VMM 服务器上。

  7. 升级到最新的可用 UR 或批准所有的 VMM 服务器上有关您环境的 UR,然后更新到最新的 VMM 代理该样式的 UR 级别的所有主机。

需要更多帮助?

扩展你的技能
了解培训
抢先获得新功能
加入 Microsoft 内部人员

此信息是否有帮助?

你对翻译质量的满意程度如何?

哪些因素影响了你的体验?

是否还有其他反馈?(可选)

谢谢您的反馈意见!

×