Intel AMT Features > Storage Administration and Operations > Use Cases > Storage: Create a Block for the Registered Application
CollapseAll image

Storage: Create a Block for the Registered Application

An application should create a new block either the first time it is registered, or when it needs additional space.

1.  Register the application, as described in the Storage: Register Application, Perform Task, Unregister Application flow. You should have the session handle and application handle available.

2.  Invoke AMT_ThirdPartyDataStorageService.AllocateBlock with the following input parameters:

Parameter

Description/Value

SessionHandle

The session handle.

BytesRequested

The size of the block in bytes.

BlockHidden

Whether the block is to be hidden or not, as a Boolean.

BlockName

The block name as a string of up to 32 characters.

 

The handle of the new block is returned as an output parameter.

Click here for a snippet demonstrating this step

You can execute this snippet by inserting it into the execution template found here.

  

$thirdPartyDataStorageServiceRef =$wsmanConnectionObject.NewReference("SELECT * FROM AMT_ThirdPartyDataStorageService WHERE Name='Intel(r) AMT Third Party Data Storage Service'")

$inputObject =$thirdPartyDataStorageServiceRef.CreateMethodInput("AllocateBlock")

# $sessionHandle is the session handle returned by 'RegisterApplication' method.

$inputObject.SetProperty("SessionHandle",$sessionHandle.ToString())

$inputObject.SetProperty("BytesRequested","4096")

$inputObject.SetProperty("BlockHidden","true")

$inputObject.SetProperty("BlockName","MyBlock")

$outputObject =$thirdPartyDataStorageServiceRef.InvokeMethod($inputObject)

$returnValue =$outputObject.GetProperty("ReturnValue")

if($returnValue -like "0")

{

    $blockHandle =$outputObject.GetProperty("BlockHandle")

}

 

 

3.  You must use the block handle for subsequent operations that require a block handle, such as reading or writing the block.

4.  Unregister the application when done. See Storage: Register Application, Perform Task, Unregister Application.

Additional Information

Intel AMT allows multiple blocks to have the same name. It is the block handle which distinguishes one block from another.

Instance Diagram

Not applicable

Classes Used in This Flow

SDK Sample

If there is a sample demonstrating this flow, it is included in the SDK installation file. See SDK Installation Layout for details.

 

See Also:

   Storage Concepts and Objects

   Application Development Guidelines

   Examples of Using the Storage Feature

Copyright © 2006-2022, Intel Corporation. All rights reserved.