Megosztás a következőn keresztül:


Install and Configure High Availability Printing

 

Applies To: Windows Server 2012

Before attempting to install and configure a highly available Print Server, install and configure Hyper-V and Failover Clustering on at least two physical servers. Once Hyper-V and Failover Clustering have been installed on both servers, create a cluster and make sure the virtual machines are stored on a Cluster Shared Volume. Once the initial setup of Hyper-V and Failover Clustering is complete, install a Windows Server 2012 virtual machine and configure the virtual machine for failover.

For more information about Hyper-V Failover Clustering, see Failover Clustering Overview.

Once the virtual machine that will host Print and Document services has been configured with initial settings, the Print and Document role services can be installed using Add Roles and Features in Server Manager.

For more information about installing Print and Document Services, see Install Print and Document Services.

Configure and manage high availability printing

Management of a Windows Server 2012 Print Server is done using the Print Management Console (PMC) MMC snap-in, which has been updated to support the new Windows Server 2012 features. Internet Printing is also managed using the PMC, and LPD Printing uses command line tools for configuration and remains unchanged from Windows Server 2008 R2.

Windows Server 2012 introduces a new set of Windows PowerShell cmdlets that can be used to manage print servers and print queues from the command line. Wherever possible, examples on how to use these cmdlets will be shown for common print management scenarios. For more information, see Print Management Cmdlets in Windows PowerShell.

Configuration and management of the Print Server role as a highly available print server is identical to that of a standalone print server. For details on how to use the Print Management Console to configure and manage a print server, see Configure Print and Document Services.

The following section will guide you through the steps to configure a highly available Print Server with Virtual Machine Monitoring:

Note

This topic includes sample Windows PowerShell cmdlets that you can use to automate some of the procedures described. For more information, see Using Cmdlets.

Step 1: Configure the firewall

Prior to enabling the Virtual Machine Monitoring feature, the firewall must be correctly configured on the highly available print server virtual machine.

To configure the firewall on the HA Print Server virtual machine

  1. Open Server Manager and then click Local Server in the navigation pane.

  2. Click the link to the right of Windows Firewall to open the Windows Firewall Control Panel. This link will display differently depending on the state of the firewall.

  3. Click Allow an app or feature through Windows Firewall in the left pane to open the Allowed Apps control panel applet.

  4. Click Change Settings and scroll down to Virtual Machine Monitoring. Check the boxes for Domain, Private, and Public and then click OK.

Step 2: Configure Virtual Machine Monitoring

The Virtual Machine Monitoring feature of Windows Server 2012 allows for greater control of a clustered virtual machine by monitoring the Print Spooler service in the virtual machine for failures, or by monitoring specific events on the virtual machine. If the Print Spooler fails or a specific event is logged in the event log, the clustering virtual machine monitoring feature will invoke the following recovery actions:

  • By default, the Print Spooler service recovery actions are configured so that the Service Control Manager will handle the first two failures of the Print Spooler service. On the first and second service failures, Service Control Manager will restart the Print Spooler service.

  • The Cluster service will handle the third failure of the Print Spooler service and will restart the virtual machine using the Virtual Machine Monitoring feature.

  • On the first occurrence of an event, Virtual Machine Monitoring will restart the virtual machine.

  • On the second occurrence of an event, Virtual Machine Monitoring will failover the virtual machine to another node in the cluster in the event of a second failure within the RetryPeriod and then restart the virtual machine. By default, the RetryPeriod is 15 minutes.

  • If the Cluster service has moved the virtual machine to all nodes of the cluster within the FailoverPeriod then the virtual machine is left in a failed state on the last node that owned the virtual machine. By default, the FailoverPeriod is 6 hours.

The Virtual Machine Monitoring feature is installed by default when the Failover Clustering role is installed on the Hyper-V host but is not configured. The features needed for Virtual Machine Monitoring to take corrective action of a virtual machine are built-in to Windows Server 2012, however the firewall must be correctly configured. Configuration of the Virtual Machine Monitoring feature is done using either the Failover Cluster Manager or Windows PowerShell.

For example, in Windows Server 2012 there are a couple Print Spooler failure scenarios that you may want to monitor with Virtual Machine Monitoring:

  • A failure of the Print Spooler service.

  • A particular Event ID, such as 373 logged in the Microsoft-Windows-PrintService/Admin event log:

    Log Name:      Microsoft-Windows-PrintService/Admin
    Source:        Microsoft-Windows-PrintService
    Date:          2/14/2011 4:05:25 PM
    Event ID:      373
    Task Category: Printing a document
    Level:         Error
    Keywords:      Classic Spooler Event,Document Print Job
    User:          SYSTEM
    Computer:
    Description:
    The spooler has detected that a component has an unusually large number of open Graphical Device Interface (GDI) objects. As a result, some enhanced metafile (EMF) print jobs might not print until the spooler is restarted.
    

To configure a service to be monitored for failures on the virtual machine, you can use Failover Cluster Manager. Any node in the cluster can be used to configure the monitoring, but this feature cannot be configured using Hyper-V Manager.

To configure the service that will be monitored by the Virtual Machine Monitoring feature

  1. Open Failover Cluster Manager on one of the nodes of the cluster, and connect to the cluster that you wish to manage.

  2. Click the Roles node under the cluster name that you wish to configure. Each virtual machine that is clustered will display in the middle pane.

  3. Right click the virtual machine that will be monitored and select More Actions, and then Configure Monitoring.

    Configure monitoring

  4. Select the Print Spooler from the list of services by checking the box next to it.

    Select services

  5. When successfully configured, the lower pane of Failover Cluster Manager should show Print Spooler listed next to Monitored Services when the HA Print Server is selected.

    Monitored services

Windows PowerShell equivalent commands

To configure the Virtual Machine Monitoring feature to monitor the Print Server virtual machine Print Spooler service, open an administrative Windows PowerShell command prompt on the Hyper-V host that currently owns the highly available print server virtual machine and type the following command:

Windows PowerShell command

Add-ClusterVMMonitoredItem -vm "<name of print server>" -service spooler

Where <name of print server> is the name of the highly available print server virtual machine. The name should be the Hyper-V virtual machine name, not the NetBIOS or FQDN name of the print server on the network.

The Add-ClusterVMMonitoredItem cmdlet can be used to configure a VM for monitoring of a service and an event. Although service monitoring can also be configured using the Failover Cluster Manager interface, event monitoring can only be configured using Windows PowerShell.

To configure the Virtual Machine Monitoring feature to monitor the Print Server virtual machine event log for a particular event ID (for example 373), open an administrative Windows PowerShell command prompt on the Hyper-V host that currently owns the highly available print server virtual machine and type the following command:

Windows PowerShell command

Add-ClusterVMMonitoredItem -vm "<name of print server>" -eventlog "Microsoft-Windows-PrintService/Admin" -eventsource Microsoft-Windows-PrintService -eventid 373

Where <name of print server> is the name of the highly available print server virtual machine. The name should be the Hyper-V virtual machine name, not the NetBIOS or FQDN name of the print server on the network.

Step 3: Verify the Virtual Machine Monitoring configuration

The Get-ClusterVMMonitoredItem cmdlet can be used to verify the configuration of Virtual Machine Monitoring for a specific virtual machine. Type the following command to display the Virtual Machine Monitoring configuration for a specific virtual machine:

Windows PowerShell command

Get-ClusterVMMonitoredIem "HA Print Server"

The output of this command for a correctly configured highly available print server should show that both spooler monitoring and event ID 373 monitoring are enabled:

Name
----
Microsoft-Windows-PrintService+Admin,Microsoft-Windows-PrintService,373
Spooler

Step 4: Testing Virtual Machine Monitoring

To verify the configuration of Virtual Machine Monitoring it is necessary to simulate a failure of the Print Spooler service or manually generate an event ID 373 using an event generating tool.

To test the functionality of Virtual Machine Monitoring of the highly available Print Server

  1. Open Task Manager on the Print Server and terminate the Print Spooler process (spoolsv.exe) three times to simulate a spooler failure. The Service Control Manager will restart the Print Spooler process the first two times and Virtual Machine Monitoring will not take action until the third simulated spooler failure.

    Note

    Stopping the Print Spooler service is not considered a failure and will not trigger a recovery action by the Virtual Machine Monitoring feature.

  2. Failover Cluster Manager will indicate Running (Application in VM Critical) on the virtual machine status.

  3. An Event ID 1250 indicating an embedded failure will be logged in the system event log.

  4. The highly available print server virtual machine will restart automatically.

  5. After the virtual machine reboots, terminate the Print Spooler process a second time within 15 minutes using Task Manager.

  6. Failover Cluster Manager will indicate that the application in the virtual machine is critical and another event 1250 is logged in the system event log.

  7. The highly available print server virtual machine is shutdown and then should failover based on the cluster configuration.

See Also

High Availability Printing Overview