« Back to Technical Discussions

Invoke-XMLCommand in UCSPS

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hi,
I was trying to help one of my customer to run an UCS XML command using the UCSPS module.  I am getting error when executing this following:
 
CS> Invoke-XmlCommand -XMLStringList "<configResolveClass cookie="1315342590/7f37c5b8-c85e-4ac4-b8c0-879e4094ccfb" classId="equipmentChassis"/>"
 
Just wondering if anyone tried to invke-xmlcommand. Please let me know..
 
Also, is there a way to set the type of the template in set-vnicTemplate or add-vnic-template?
 
Thanks,
Ravi

Hi,
I was trying to help one of my customer to run an UCS XML command using the UCSPS module.  I am getting error when executing this following:
 
CS> Invoke-XmlCommand -XMLStringList "<configResolveClass cookie="1315342590/7f37c5b8-c85e-4ac4-b8c0-879e4094ccfb" classId="equipmentChassis"/>"
 
Just wondering if anyone tried to invke-xmlcommand. Please let me know..
 
Also, is there a way to set the type of the template in set-vnicTemplate or add-vnic-template?
 
Thanks,
Ravi

 
Either of these should work.
 

$UCSM = Connect-UCSM IP or FQDN
Invoke-XmlCommand -XMLStringList "<configResolveClass cookie='$($UCSM.Cookie)' classId='equipmentChassis'/>"
$UCSM.InvokeXmlCommand("<configResolveClass cookie='$($UCSM.Cookie)' classId='equipmentChassis'/>")

Ravi,

The problem with your command is you double quotes (") ends your string so the class type equipmentChassis isn't surrounded by quotes in the string passed to the XML. You can resolve this either by using an extra double quote when inside a string like ""equipmentChassis"" or by a single quote as Philip did in his example so just 'equipementChassis'. In my experience, you don't need to include the cookie when using the Invoke-XmlCommand cmdlet as it gets the cookie from the connection object.

I am not sure I understand what you saying when you are trying to set a vnic template type.

Ravi,

The default templType gets set to initial-template, there currently is not a way to set it via the Add-VnicTemplate or Set-VnicTemplate. Building on Phillip's example you could do it like this

Invoke-XmlCommand -XMLStringList "<configConfMo cookie='$($UCSM.Cookie)'><inConfig><vnicLanConnTempl name='jomcdono-eth0' dn=' org-root/lan-conn-templ-jomcdono-eth0' templType='updating-template' status='modified'/></inConfig></configConfMo>"

In the example I'm changing the template jomcdono-eth0 to an updating-template.

Hope that helps

John

Thanks everyone for your valuable information. This will make my customer
very happy.
Thanks,
Ravi


On 9/20/11 12:12 PM, "Cisco Developer Community Forums"
<cdicuser@developer.cisco.com> wrote:

> John McDonough has created a new message in the forum "Technical Discussions":
>
> --------------------------------------------------------------
> Ravi,
>
> The default templType gets set to initial-template, there currently is not a
> way to set it via the Add-VnicTemplate or Set-VnicTemplate. Building on
> Phillip's example you could do it like this
>
> Invoke-XmlCommand -XMLStringList "<configConfMo
> cookie='$($UCSM.Cookie)'><inConfig><vnicLanConnTempl name='jomcdono-eth0' dn='
> org-root/lan-conn-templ-jomcdono-eth0' templType='updating-template'
> status='modified'/></inConfig></configConfMo>"
>
> In the example I'm changing the template jomcdono-eth0 to an
> updating-template.
>
> Hope that helps
>
> John
> --
> To respond to this post, please click the following link:
>
> <http://developer.cisco.com/web/unifiedcomputing/forums/-/message_boards/view_
> message/4515436>
>
> or simply reply to this email.


Thanks,
-- Ravi Jandyala

Unified Compute Architecture Practice
Cisco Advanced Services
Cisco Systems, Inc.
Phone: (919) 392-2997
Mobile: (919) 699-1639

ravishan@cisco.com