Intel® Business Client Software Development
Support for Intel® vPro™ software development and technologies associated with Intel vPro platforms.

Missing file from SDK: OpenWsmanLib.vcproj

mugwump
Beginner
1,360 Views
Hi,

While there is a pre-compiled lib for OpenWsman available, I am having trouble finding some parts for compiling my own.

In the 5.1.1 SDK, in \Intel_AMT_SDK_Release_5.1.1\Windows\Common\WS-Management\C++\Readme.txt it says that :

"The Package includes a Visual Studio (2005) project, OpenWsmanLib.vcproj in ThirdParty->openwsman for compiling the library."

However, the SDK doesn't include this file. I also can't find OpenWsmanClient.cpp, which I assume would be needed for compiling the implementation of WsmanClient for use with OpenWsman.
0 Kudos
17 Replies
mugwump
Beginner
1,360 Views
Correction: I have looked at the Openwsman distribution now and see that the WsManClient header is declared there, and OpenWsManClient.cpp comes from there too. Now it all makes a bit more sense :) It would be great if you could clarify this a little more in the documentation.
0 Kudos
Lance_A_Intel
Employee
1,360 Views
Quoting - mugwump
Correction: I have looked at the Openwsman distribution now and see that the WsManClient header is declared there, and OpenWsManClient.cpp comes from there too. Now it all makes a bit more sense :) It would be great if you could clarify this a little more in the documentation.

Yes, as we are moving toward more people using the AMT WS-Man we are finding many places where the documetation needs to be improved.

This is good feedback, thanks.
0 Kudos
Gael_H_Intel
Moderator
1,360 Views

Yes, as we are moving toward more people using the AMT WS-Man we are finding many places where the documetation needs to be improved.

This is good feedback, thanks.

You might also want to check out the High Level API package and take a look at Stephen Hibbert's blogs on it. It probably isn't supporting all the features that you are interested in at the moment, but if we can get a company to start using it, our development team will be able to modify their roadmap to better suit your needs. Here is the link to the HLAPI and here is the link to Stephen's Blogs.

Note that the Demo that is on the site needs to be refreshed - there should be a new one pretty soon.
0 Kudos
mugwump
Beginner
1,360 Views

You might also want to check out the High Level API package and take a look at Stephen Hibbert's blogs on it. It probably isn't supporting all the features that you are interested in at the moment, but if we can get a company to start using it, our development team will be able to modify their roadmap to better suit your needs. Here is the link to the HLAPI and here is the link to Stephen's Blogs.

Note that the Demo that is on the site needs to be refreshed - there should be a new one pretty soon.

Yes I am already excited with the high level API, and will be looking at using it for 3rd party storage. I will probably have to use OpenWsMan for stuff the HL API doesn't do yet. WRM is too heavyweight and requires too much setup (the Trusted Hosts list kills me!).
0 Kudos
Gael_H_Intel
Moderator
1,360 Views
Quoting - mugwump

Yes I am already excited with the high level API, and will be looking at using it for 3rd party storage. I will probably have to use OpenWsMan for stuff the HL API doesn't do yet. WRM is too heavyweight and requires too much setup (the Trusted Hosts list kills me!).

Excellent! As you start using it, let us know which features you desparately need - the development team is anxious to work with ISVs who commit to adopting it and that means that it may be very easy to get your needs added to the package. I know you are working with Andy so we can further your input/needsforthe HL API through Andy.

Stephen was able to clean up his SDK storage code (it ended up being 300 lines because it was confusing) - once he figured it out, it took 85 lines of codeusing the SDK and 18 lines of codeto do the same thing using the HLAPI software - that is very encouraging!
0 Kudos
mugwump
Beginner
1,360 Views

Excellent! As you start using it, let us know which features you desparately need - the development team is anxious to work with ISVs who commit to adopting it and that means that it may be very easy to get your needs added to the package. I know you are working with Andy so we can further your input/needsforthe HL API through Andy.

Stephen was able to clean up his SDK storage code (it ended up being 300 lines because it was confusing) - once he figured it out, it took 85 lines of codeusing the SDK and 18 lines of codeto do the same thing using the HLAPI software - that is very encouraging!

Does the HL API make use of WRM for its WS-Management client, or is DotNetWSManClient_5_0.dll completely self-enclosed?
0 Kudos
mugwump
Beginner
1,360 Views

Excellent! As you start using it, let us know which features you desparately need - the development team is anxious to work with ISVs who commit to adopting it and that means that it may be very easy to get your needs added to the package. I know you are working with Andy so we can further your input/needsforthe HL API through Andy.

Stephen was able to clean up his SDK storage code (it ended up being 300 lines because it was confusing) - once he figured it out, it took 85 lines of codeusing the SDK and 18 lines of codeto do the same thing using the HLAPI software - that is very encouraging!

One major thing I'd need is the ability to use CIRA-triggered connections in the HL API :S
0 Kudos
mugwump
Beginner
1,360 Views

Excellent! As you start using it, let us know which features you desparately need - the development team is anxious to work with ISVs who commit to adopting it and that means that it may be very easy to get your needs added to the package. I know you are working with Andy so we can further your input/needsforthe HL API through Andy.

Stephen was able to clean up his SDK storage code (it ended up being 300 lines because it was confusing) - once he figured it out, it took 85 lines of codeusing the SDK and 18 lines of codeto do the same thing using the HLAPI software - that is very encouraging!

Also, is there a way to use the HL API against a local system, like for use in an agent?

BTW, I'm seeing the following issues using the Sprint 7 Preview of the HL API:

- Accessing PowerSupply causes ArgumentOutOfRangeException
- Accessing Fan causes ArgumentOutOfRangeException
- Calling StorageAdmin.SetStorageLimits causes NullReferenceException
0 Kudos
Gael_H_Intel
Moderator
1,360 Views
Quoting - mugwump

Also, is there a way to use the HL API against a local system, like for use in an agent?

BTW, I'm seeing the following issues using the Sprint 7 Preview of the HL API:

- Accessing PowerSupply causes ArgumentOutOfRangeException
- Accessing Fan causes ArgumentOutOfRangeException
- Calling StorageAdmin.SetStorageLimits causes NullReferenceException

Interesting.... I will forward this on to our Developers! Thank you for your feedback.
0 Kudos
Gael_H_Intel
Moderator
1,360 Views

Interesting.... I will forward this on to our Developers! Thank you for your feedback.


Actually... I should make sure your environment is correct for the HLAPI - since it is being developed for compatibility with our next major release of the SDK, your environment might not be quite right.. Could you check the following:

Management ConsoleRequirements:
OS: Windows 7, Vista SP1, XP SP3, Windows Server 2003, Windows Server 2008 or Windows Server 2008 R2
.Net Framework 3.0 (comes native with Vista)
Development Environment
OS: Windows 7, Vista SP1, or XP SP3
.Net Framework 3.0
Visual Studio 2008 (note that the AMT SDK 5.x is still using VS 2005)

Also, what version of AMT are you trying this against? I'm assuming 5.x? (5 is good!)

0 Kudos
mugwump
Beginner
1,360 Views

Interesting.... I will forward this on to our Developers! Thank you for your feedback.


Actually... I should make sure your environment is correct for the HLAPI - since it is being developed for compatibility with our next major release of the SDK, your environment might not be quite right.. Could you check the following:

Management ConsoleRequirements:
OS: Windows 7, Vista SP1, XP SP3, Windows Server 2003, Windows Server 2008 or Windows Server 2008 R2
.Net Framework 3.0 (comes native with Vista)
Development Environment
OS: Windows 7, Vista SP1, or XP SP3
.Net Framework 3.0
Visual Studio 2008 (note that the AMT SDK 5.x is still using VS 2005)

Also, what version of AMT are you trying this against? I'm assuming 5.x? (5 is good!)

XP SP3, .NET 3, Visual Studio 2008, AMT 5.1
0 Kudos
Gael_H_Intel
Moderator
1,360 Views
Quoting - mugwump
XP SP3, .NET 3, Visual Studio 2008, AMT 5.1

Ok - that's good! You aren't trying to mix SDK code with the HLAPI Code, are you? Can you supply a code snippet that we could test out over here?
0 Kudos
mugwump
Beginner
1,360 Views

Ok - that's good! You aren't trying to mix SDK code with the HLAPI Code, are you? Can you supply a code snippet that we could test out over here?

Actually, it looks to me like the ManageabilityStack included with the DTK is already sort of a "high level" API that does even more... with the advent of the HP API is that component going to be dropped?

I did some more HL API stuff and had some trouble with storage. I'll include a snippet for that too. It seems weird that you have to Register an application to read storage blocks through the HL API. When I try to do that it shows me 2 vendor apps but both have 0'd out UUIDs (i'm expecting at least one app to have a non-0 UUID). Also, when I call GetBlocks() it gives me an exception. The ManageabilityStack stuff is able to access this storage no problem.

Here is some code that messes up on PowerSupply for me:


static void Main(string[] args)
{
// Check arguments.
if (3 != args.Length)
{
Console.Out.WriteLine(
"Usage: blah.exe ");
return;
}

Console.WriteLine(
String.Format(
"Connecting with IP: {0} Username: {1} Password: {2} ...",
args[0],
args[1],
args[2]));

ConnectionInfo connInfo = new ConnectionInfo(
args[0],
args[1],
args[2],
false,
null,
ConnectionInfo.AuthMethod.Digest,
null,
null);

IAMTInstance amt = AMTInstanceFactory.Create(connInfo);

Console.WriteLine();

// Get hardware information.
ComputerSystem computer = amt.HardwareAsset.ComputerSystem;

Console.WriteLine("Computer");
Console.WriteLine("Computer model: " + computer.Product);
Console.WriteLine("Manufacturer: " + computer.Manufacturer);
Console.WriteLine("Version: " + computer.Version);
Console.WriteLine("Serial number: " + computer.SerialNumber);

Console.WriteLine();

Processor[] procs = amt.HardwareAsset.CPUs;
foreach (Processor proc in procs)
{
Console.WriteLine("CPU");
Console.WriteLine("Manufacturer: " + proc.Manufacturer);
Console.WriteLine("Physical Position: " + proc.PhysicalPosition);
Console.WriteLine("Current speed: " + proc.CurrentClockSpeed);
Console.WriteLine("Max speed: " + proc.MaxClockSpeed);
Console.WriteLine();
}

// Causes ArgumentOutOfRangeException. Fan does too.
PowerSupply power = amt.HardwareAsset.PowerSupply;
if (null != power)
{
Console.WriteLine("Power Supply");
Console.WriteLine("Data Valid: " + power.DataValid);
if (power.DataValid)
{
Console.WriteLine("Device ID: " + power.DeviceID);
Console.WriteLine("Total Output Power: " + power.TotalOutputPower);
}
}


Here is the afore mentioned Storage stuff:

ConnectionInfo connInfo = new ConnectionInfo(
args[0],
args[1],
args[2],
false,
null,
ConnectionInfo.AuthMethod.Digest,
null,
null);

IAMTInstance amt = AMTInstanceFactory.Create(connInfo);

Console.WriteLine();

// Retrieve storage.
IStorageApplication app = amt.Storage.RegisterApplication(
Constants.ENTERPRISE_NAME,
Constants.VENDOR_NAME,
Constants.APP_NAME,
SERVER_GUID);

IAccessableBlock block = null;

foreach (IVendorApplication vendorApp in app.VendorApps)
{
System.Console.Out.WriteLine("Vendor app: " + vendorApp.Application + " UUID: " + vendorApp.UUID);

// Causes an exception.
IAccessableBlock[] blocks = vendorApp.GetBlocks();
}
0 Kudos
Gael_H_Intel
Moderator
1,360 Views
Quoting - mugwump

Actually, it looks to me like the ManageabilityStack included with the DTK is already sort of a "high level" API that does even more... with the advent of the HP API is that component going to be dropped?

I did some more HL API stuff and had some trouble with storage. I'll include a snippet for that too. It seems weird that you have to Register an application to read storage blocks through the HL API. When I try to do that it shows me 2 vendor apps but both have 0'd out UUIDs (i'm expecting at least one app to have a non-0 UUID). Also, when I call GetBlocks() it gives me an exception. The ManageabilityStack stuff is able to access this storage no problem.

Here is some code that messes up on PowerSupply for me:


static void Main(string[] args)
{
// Check arguments.
if (3 != args.Length)
{
Console.Out.WriteLine(
"Usage: blah.exe ");
return;
}

Console.WriteLine(
String.Format(
"Connecting with IP: {0} Username: {1} Password: {2} ...",
args[0],
args[1],
args[2]));

ConnectionInfo connInfo = new ConnectionInfo(
args[0],
args[1],
args[2],
false,
null,
ConnectionInfo.AuthMethod.Digest,
null,
null);

IAMTInstance amt = AMTInstanceFactory.Create(connInfo);

Console.WriteLine();

// Get hardware information.
ComputerSystem computer = amt.HardwareAsset.ComputerSystem;

Console.WriteLine("Computer");
Console.WriteLine("Computer model: " + computer.Product);
Console.WriteLine("Manufacturer: " + computer.Manufacturer);
Console.WriteLine("Version: " + computer.Version);
Console.WriteLine("Serial number: " + computer.SerialNumber);

Console.WriteLine();

Processor[] procs = amt.HardwareAsset.CPUs;
foreach (Processor proc in procs)
{
Console.WriteLine("CPU");
Console.WriteLine("Manufacturer: " + proc.Manufacturer);
Console.WriteLine("Physical Position: " + proc.PhysicalPosition);
Console.WriteLine("Current speed: " + proc.CurrentClockSpeed);
Console.WriteLine("Max speed: " + proc.MaxClockSpeed);
Console.WriteLine();
}

// Causes ArgumentOutOfRangeException. Fan does too.
PowerSupply power = amt.HardwareAsset.PowerSupply;
if (null != power)
{
Console.WriteLine("Power Supply");
Console.WriteLine("Data Valid: " + power.DataValid);
if (power.DataValid)
{
Console.WriteLine("Device ID: " + power.DeviceID);
Console.WriteLine("Total Output Power: " + power.TotalOutputPower);
}
}


Here is the afore mentioned Storage stuff:

ConnectionInfo connInfo = new ConnectionInfo(
args[0],
args[1],
args[2],
false,
null,
ConnectionInfo.AuthMethod.Digest,
null,
null);

IAMTInstance amt = AMTInstanceFactory.Create(connInfo);

Console.WriteLine();

// Retrieve storage.
IStorageApplication app = amt.Storage.RegisterApplication(
Constants.ENTERPRISE_NAME,
Constants.VENDOR_NAME,
Constants.APP_NAME,
SERVER_GUID);

IAccessableBlock block = null;

foreach (IVendorApplication vendorApp in app.VendorApps)
{
System.Console.Out.WriteLine("Vendor app: " + vendorApp.Application + " UUID: " + vendorApp.UUID);

// Causes an exception.
IAccessableBlock[] blocks = vendorApp.GetBlocks();
}


For Storage - here is a snippet that works. You'll have to modify things to fit your environment. Let us know if you can get yours to work?

static void Main()

{

IAMTInstance inst = AMTInstanceFactory.Create(new ConnectionInfo("192.168.1.100", "admin", "P@ssw0rd", false, null, ConnectionInfo.AuthMethod.Digest, null, null));

bool isDuplicate;

inst.StorageAdmin.AddEnterprise("Intel", out isDuplicate);

bool appAlreadyExists;

inst.StorageAdmin.AddPartnerApplication("SimplyAMT", "HLAPIStorage", (uint)(1 * inst.Storage.MTU), out appAlreadyExists);

IStorageApplication application = inst.Storage.RegisterApplication("Intel", "SimplyAMT", "HLAPIStorage", new Guid("00000000000000000000000000000000"));

IBlock block;

if (application.GetBlocks() == null)

{

block = application.CreateBlock("HelloWorld", (uint)(1 * (inst.Storage.MTU)), false);

block.WriteToBlock((uint)0, (uint)(1 * inst.Storage.MTU), UTF8Encoding.UTF8.GetBytes("Hello World!"));

}

else

{

block = application.GetBlocks()[0];

}

int bytesRead;

byte[] data = block.ReadFromBlock((uint)0, (uint)(1 * inst.Storage.MTU), out bytesRead);

Console.WriteLine("Read {0} bytes: "{1}"", bytesRead, UTF8Encoding.UTF8.GetString(data).Substring(0, findEnd(data)));

Console.WriteLine("nPress Enter to exit...");

Console.ReadLine();

}

0 Kudos
Gael_H_Intel
Moderator
1,360 Views


For Storage - here is a snippet that works. You'll have to modify things to fit your environment. Let us know if you can get yours to work?

static void Main()

{

IAMTInstance inst = AMTInstanceFactory.Create(new ConnectionInfo("192.168.1.100", "admin", "P@ssw0rd", false, null, ConnectionInfo.AuthMethod.Digest, null, null));

bool isDuplicate;

inst.StorageAdmin.AddEnterprise("Intel", out isDuplicate);

bool appAlreadyExists;

inst.StorageAdmin.AddPartnerApplication("SimplyAMT", "HLAPIStorage", (uint)(1 * inst.Storage.MTU), out appAlreadyExists);

IStorageApplication application = inst.Storage.RegisterApplication("Intel", "SimplyAMT", "HLAPIStorage", new Guid("00000000000000000000000000000000"));

IBlock block;

if (application.GetBlocks() == null)

{

block = application.CreateBlock("HelloWorld", (uint)(1 * (inst.Storage.MTU)), false);

block.WriteToBlock((uint)0, (uint)(1 * inst.Storage.MTU), UTF8Encoding.UTF8.GetBytes("Hello World!"));

}

else

{

block = application.GetBlocks()[0];

}

int bytesRead;

byte[] data = block.ReadFromBlock((uint)0, (uint)(1 * inst.Storage.MTU), out bytesRead);

Console.WriteLine("Read {0} bytes: "{1}"", bytesRead, UTF8Encoding.UTF8.GetString(data).Substring(0, findEnd(data)));

Console.WriteLine("nPress Enter to exit...");

Console.ReadLine();

}


Mugwump - do you have a system that still has the 5.0 firmware on it? If so, would you mind testing your code on that system to see if you still get errors?

Also to answer one of your other questions: The DotNetWsmanClient is a standalone WS-Man client and it has nothing to do with WinRM.
0 Kudos
mugwump
Beginner
1,360 Views

Mugwump - do you have a system that still has the 5.0 firmware on it? If so, would you mind testing your code on that system to see if you still get errors?

Also to answer one of your other questions: The DotNetWsmanClient is a standalone WS-Man client and it has nothing to do with WinRM.

With respect to the sample storage code you posted, this works fine. However it only ever uses a blank GUID so it's not really adaptable to a situation where the client writes to itself and the server reads.

Unfortunately I don't have a 5.0 system at this time to test on, sorry.
0 Kudos
Andrew_S_Intel2
Employee
1,360 Views
Quoting - mugwump

With respect to the sample storage code you posted, this works fine. However it only ever uses a blank GUID so it's not really adaptable to a situation where the client writes to itself and the server reads.

Unfortunately I don't have a 5.0 system at this time to test on, sorry.

I believe the typical use model would be that the server and client sides would agree to the UUID via some OOB mechanism. The most likely one I can think of would be for a set UUID for a given application (or possibly application, and version of the application). The main purpose is to uniquely identify what application is performing the storage, so it is necessary to agree in advance as to what the UUID is. I believe another alternative would be to use the system UUID to uniquely identify the application (since it already uniquely identify's the system), the ISVS_GetHostUUID call described in the Storage Design Guide would be used in this case.

The code snippet Gael gave should work in either case, for the first the application would have a predefined UUID (instead of all 0's), for the second you'd make the call to get the UUID, then use it as an argument.
0 Kudos
Reply