Intel® AMT Remote Wake Methods from Companion Devices

Introduction

This white paper describes how Intel® Active Management Technology (Intel® AMT) may be used to perform remote wake functions to wake a PC from a companion device such as an Intel® Atom™ based tablet. We will look at two different topologies for performing remote wake and discuss the three methods of remote wake.

What is Intel® AMT?

Intel® Active Management Technology (Intel® AMT) is a capability embedded in Intel-based platforms that enhances the ability of IT organizations to manage enterprise computing facilities. Intel AMT operates independently of the platform processor and operating system. Remote platform management applications can access Intel AMT securely, even when the platform is turned off, as long as the platform is connected to line power and to a network. Independent software vendors (ISVs) can build applications that take advantage of the features of Intel AMT using the application programming interface (API).

Intel AMT lets you remotely access computers when the operating system is not available or the computer is turned off. The only requirement is that the computer must be connected to a power supply and a network. The Remote Control feature provides the ability to turn a host platform on and off. This interface can retrieve the current power state and change the power state of the Intel® vPro machine via commands to Intel AMT.

Intel® AMT Setup and Configuration

The Intel AMT client that you wish to power control must be properly setup and configured, or provisioned, so that companion devices can access Intel AMT features. Provisioning is beyond the scope of this document. Some options for configuring Intel AMT clients include using the PowerShell module (http://communities.intel.com/docs/DOC-4800) or downloading the Intel® Setup and Configuration Service (Intel® SCS). You can also find more information about provisioning at http://www.intel.com/go/vpro101.

Remote Wake Connection Types

There are two connection options by which a companion device may connect to and perform remote control actions on an Intel AMT client: Server/cloud connection and Peer-to-peer connection. How APIs are called depends on this distinction.

Server/Cloud Connection to Intel AMT Client

While on the same network (inside the corporate network) or from outside the corporate network (through a DMZ service bridging public and private networks), a device (i.e. tablet) app sends an API command to the server/cloud instance to initiate a power on; the server/cloud service sends the Intel AMT WS-MAN Power On command with authentication to the Intel AMT PC allowing to power on.

Note:

  • The proprietary API between the tablet and server is not specified by this document.
  • The API for Intel AMT Power On would be called by the server-based instance. PowerShell examples are provided in section below on “Server PowerShell APIs”.

Peer-to-Peer Connection to Intel AMT Client

While being on the same routable network (i.e. corporate network) a device (i.e. tablet) app sends the Intel AMT WS-MAN Power On command with authentication to the Intel AMT PC allowing the PC to power on.



Note: The API for Intel AMT Power On would be called by the tablet device. See section on “Android APIs” below for sample Android code which could be used for this command.

APIs and Sample Code for Intel® AMT Remote Wake

Server or Windows Tablet APIs

A set of APIs is provided to perform Remote Wake calls from a server in a Server/Cloud Connection scenario, or from a Windows tablet in a Peer-to-Peer scenario. The below information is taken directly from the "Intel AMT Implementation and Reference Guide". SDK samples are located at: <SDK_root>\Windows\Intel_AMT\Samples\WS-Management\RemoteControl

Get System Power State

The following steps describe how to determine the power state of the platform.

  1. Find the instance of CIM ComputerSystem representing the managed host, as described in Discovering CIM ComputerSystem.
  2. Retrieve the power management association to service instance by invoking Enumerate with association Filter using association instance with the following parameters:
     
    Parameter Value
    Object The ComputerSystem reference obtained in Step 1.
    Result Class Name CIM_AssociatedPowerManagementService
  3. Examine the instance property CIM_AssociatedPowerManagementService. PowerState to see the system power state.

(PowerShell Snippet demonstrating this step.)

# Create a reference to the CIM_ComputerSystem instance.
$computerSystemRef = $wsmanConnectionObject.NewReference("SELECT * FROM CIM_ComputerSystem WHERE Name='ManagedSystem'")
$associatedPowerManagementRef = $wsmanConnectionObject.NewReference("CIM_AssociatedPowerManagementService")
$associatedPowerManagementRef.AddSelector("UserOfService", $computerSystemRef)
# Traverse to the CIM_AssociatedPowerManagementService instances that are connected to CIM_ComputerSystem instance.
foreach($associatedPowerManagementItem in $associatedPowerManagementRef.Enumerate("http://schemas.dmtf.org/wbem/wsman/1/wsman/SelectorFilter", $null))
{   
    # For each instance, check if it is associated to the CIM_PowerManagementService instance.
if($associatedPowerManagementItem.Object.GetProperty("ServiceProvided").IsA("CIM_PowerManagementService"))
    {     
          $associatedPowerManagementInstance = $associatedPowerManagementItem.Object
          $powerState = $associatedPowerManagementInstance.GetProperty("PowerState")
    }
}

Get System Power Management Capabilities

The following steps describe how to retrieve all the possible power states of a platform and all the power state changes that Intel AMT can activate.

  1. Retrieve the instance of CIM_PowerManagementCapabilities, using the “InstanceID” key equal to “Intel® AMT:PowerManagementCapabilities 0”.
  2. Examine CIM_PowerManagementCapabilities.PowerChangeCapabilities.

(PowerShell Snippet demonstrating this step.)

$powerManagementCapabilitiesRef = $wsmanConnectionObject.NewReference("SELECT * FROM CIM_PowerManagementCapabilities WHERE InstanceID='Intel® AMT:PowerManagementCapabilities 0'")
$powerManagementCapabilitiesInstance = $powerManagementCapabilitiesRef.Get()
$powerChangeCapabilities = $powerManagementCapabilitiesInstance.GetProperty("PowerChangeCapabilities")

Note: Typically a platform will support Rest, PowerUp, PowerDown, and PowerCycleReset.

Change System Power State

The following steps describe how to change the power state of the platform.

  1. Retrieve the instance of CIM_PowerManagementService, using the “Name” key equal to “Intel® AMT Power Management Service”.
  2. Invoke CIM_PowerManagementService.RequestPowerStateChange using the following parameters:
     
    Parameter Value
    Power State One of the defined power states
    Managed Element A reference to the “managed system” object
    Time NULL
    TimeoutPeriod NULL

Note:

  • If there is an active redirection session (SOL, IDE-R or KVM), then a power cycle reset or a power off command will be rejected as invalid. See Intel AMT Power State Transitions.
  • Do not request a second power state change without allowing the first request to complete. Completion in this case is defined as allowing the BIOS to inform Intel AMT that it has completed its tasks. This can take as much as 10 seconds, depending on the OEM platform.
  • The Power State must one supported by the platform. The transition must be valid from the current power state.

Android APIs

The following is basic example code demonstrating how Intel AMT API calls can be made via a connected Android companion device to power on and off an Intel® vPro™ technology-based client. WSMan library interface is used to make the remote connection. The same steps are followed as detailed above in “Change System Power State”. Note that the procedure to power off and to power on is exactly the same except for the “PowerState” property. Also note that additional checks could also be made to determine the initial power state and capabilities.

The example below would be suitable for peer to peer connections. Similar code would work for server/cloud connection, except that the Intel AMT WS-MAN commands below would be directly called in a Peer-to-peer connection, whereas this would be handled by the Server instead (upon request from the Android device) in case of the Server/Cloud connection.

Button offButton = (Button)me.findViewById(R.id.Button04);
offButton.setOnClickListener(new OnClickListener()
{
	@Override
	public void onClick(View v) 
	{
		UpdateStatus("Trying to Power Off...");

		ILibWSMan.ILibWSMan_SetHost(connection, VPRO_IP, "16992");
		ILibWSMan.ILibWSMan_SetCredential(connection, "admin", "P@ssw0rd");
		
		ILibWSMan_Reference r = ILibWSMan.ILibWSMan_NewReference(connection, "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem");
		r.AddSelector("Name", "ManagedSystem");
		r.Get(new ILibWSMan_OnGet()
		{
			@Override
			public void ILibWSMan_OnGetHandler(
					ILibWSMan_Reference sender,
					ILibWSMan_Instance instance, Object userState) 
			{
				ILibWSMan_Connection connection = (ILibWSMan_Connection)userState;
				
				ILibWSMan_Reference ref = ILibWSMan.ILibWSMan_NewReference(connection, "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_PowerManagementService");
				ILibWSMan_Item item = ILibWSMan.ILibWSMan_CreateMethodInput(ref,"RequestPowerStateChange");
				
				item.SetProperty("PowerState", "8");
				item.SetProperty("ManagedElement", sender.toString());
				ref.AddSelector("CreationClassName","CIM_PowerManagementService");
				ref.AddSelector("Name","Intel® AMT Power Management Service");
				ref.AddSelector("SystemCreationClassName","CIM_ComputerSystem");
				ref.AddSelector("SystemName","Intel® AMT");
				ref.InvokeMethod(item, new ILibWSMan_OnInvoke()
				{
					@Override
					public void ILibWSMan_OnInvokeHandler(
							ILibWSMan_Reference sender,
							ILibWSMan_Item inObject,
							ILibWSMan_Item returnObject,
							Object userState) 
					{
						UpdateStatus("Powered Off!");
					}					
				}, null);							
			}				
		}, connection);					
	}
});

Button onButton = (Button)me.findViewById(R.id.Button05);
onButton.setOnClickListener(new OnClickListener()
{
	@Override
	public void onClick(View v) 
	{
		UpdateStatus("Trying to Power On...");

		ILibWSMan.ILibWSMan_SetHost(connection, VPRO_IP, "16992");
		ILibWSMan.ILibWSMan_SetCredential(connection, "admin", "P@ssw0rd");
		
		ILibWSMan_Reference r = ILibWSMan.ILibWSMan_NewReference(connection, "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem");
		r.AddSelector("Name", "ManagedSystem");
		r.Get(new ILibWSMan_OnGet()
		{
			@Override
			public void ILibWSMan_OnGetHandler(
					ILibWSMan_Reference sender,
					ILibWSMan_Instance instance, Object userState) 
			{
				ILibWSMan_Connection connection = (ILibWSMan_Connection)userState;
				
				ILibWSMan_Reference ref = ILibWSMan.ILibWSMan_NewReference(connection, "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_PowerManagementService");
				ILibWSMan_Item item = ILibWSMan.ILibWSMan_CreateMethodInput(ref,"RequestPowerStateChange");
				
				item.SetProperty("PowerState", "2");
				item.SetProperty("ManagedElement", sender.toString());
				ref.AddSelector("CreationClassName","CIM_PowerManagementService");
				ref.AddSelector("Name","Intel® AMT Power Management Service");
				ref.AddSelector("SystemCreationClassName","CIM_ComputerSystem");
				ref.AddSelector("SystemName","Intel® AMT");
				ref.InvokeMethod(item, new ILibWSMan_OnInvoke()
				{
					@Override
					public void ILibWSMan_OnInvokeHandler(
							ILibWSMan_Reference sender,
							ILibWSMan_Item inObject,
							ILibWSMan_Item returnObject,
							Object userState) 
					{
						UpdateStatus("Powered ON!");
					}						
				}, null);						}					
		}, connection);				
	}	
});

ISV Independent Power Control Through the Web UI

The web server in the Management Engine also provides an HTML-based interface called the Web UI. Through this web page, a companion device can view basic information about the platform and perform power operations using only a browser. This offers a means of platform control that does not rely on specific third party software but can still increase the availability of Intel vPro technology-based platforms to companion devices.

To access the web UI, the companion device browser should address the fully qualified domain name or IP address of the Intel vPro technology-based system on port 16992 or 16993 depending on the configuration of transport layer security. An example would be:

http://vpromachine.yourdomain.com:16992
https://vpromachine.yourdomain.com:16993

You will initially be presented with a log on screen as shown below.



Once you authenticate as a pre-configured Intel AMT user, you will see several menu options such as Remote Control. Now you can manage the power state of the device to make it available for third party software and use cases.

Useful Links with detailed APIs

Etiquetas:
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.