cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6035
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: EELCO NIEUWSTAD on 03-02-2012 02:07:24 AM
Because I find it very boring (and I am lazy) to create aliases and zones for all HBA's of my server profiles in my MDS switch I would like to write a script to do it for me. I am just curious about the best way to do it. My approach is
- do a configResolveClass with inHierarchical="true" for all classes of lsServer add a filter to exclude the templates
- check which profiles have a childobject vnicFc (hence the inHierarchical="true")
- if they have a childobject vnicFc get all the details relevant for my zoning/aliases from it (and its child vnicFcIf)
 
I think the other way round is also possible
- get all configured VSAN on the UCS FI
- query vnicFcIf placed in that VSAN
- get the parent of the vnicFcIf to get the relevent addresses.
what should be the fastest/least impacting.
 
I also noticed something I nevert thought about. I would like to create an alias profilename-hba however the profilename can be the same as long as they are in two different organizations.
 
 

Subject: RE: best way to query WWPN of all HBA
Replied by: Vijay Balyan on 06-02-2012 02:17:51 AM
Eelco,

Yes, your first approach seems right. You can get the {wwpn,vsans} of all the HBAs using the Cisco UCS powertool 0.9.6.0

#Connect to the UCS system
PS C:\> Connect-Ucs <ucs1>

#Get wwpns of all the HBAs
PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba | Get-UcsVhbaInterface | select Dn,Initiator,Vnet

Dn                                                                     Initiator                                          Vnet
--                                                                       ---------                                            ----
org-root/ls-sp11/fc-hba1/if-default                 20:00:00:25:B5:AA:AA:AA                   1
org-root/ls-test/fc-vhba2/if-default                 20:00:00:25:B5DDD                  2


You can download the lastest version of Cisco UCS PowerTool 0.9.6.0 and Getting Started guide from
http://developer.cisco.com/web/unifiedcomputing/microsoft

Thanks,
Vijay Vikrant Balyan

Subject: RE: best way to query WWPN of all HBA
Replied by: Vijay Balyan on 06-02-2012 05:49:04 AM
Yeah, if we see from requirement view.. we can do that in a single query. Apart of it, if I am correct then there is only one XML API available to   instantiate profiles from template.
1<lsInstantiateNTemplate dn="" cookie="" inTargetOrg=""
2inServerNamePrefixOrEmpty="" inNumberOf="" inHierarchical="no">
3</lsInstantiateNTemplate>


 
 
Eelco/Dilip,
If you make use of the Cisco UCS powertool 0.9.6.0, then the in-built Ucs Cmdlets will take care of forming and sending the xml query for you.
 
PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba | Get-UcsVhbaInterface | select Dn,Initiator,Vnet
 
Dn      Initiator   Vnet
--      ---------   ----
org-root/ls-sp11/fc-hba1/if-default  20:00:00:25:B5:AA:AA:AA  1
org-root/ls-test/fc-vhba2/if-default 20:00:00:25:B5DDD  2 
 
 
The -xml option gives us more details about the internal functioning of the cmdlet. 
It shows us the query that was generated and sent when we executed the cmdlet and the response we received.
 
PS C:\> Get-UcsServiceProfile -type instance -xml
 
==>bgl-samc17:<configResolveClass classId="lsServer" cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" inHierarchical="false"><inFilter><and><e
q class="lsServer" property="type" value="instance" /><wcard class="lsServer" property="dn" value="^org-root/" /></and></inFilter></configResolveClass
>
 
<==bgl-samc17: <configResolveClass cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" response="yes" classId="lsServer"> <outConfigs>  <lsServer
 agentPolicyName="" assignState="unassigned" assocState="unassociated" biosProfileName="" bootPolicyName=""  configQualifier="" configState="not-appli
ed" descr="" dn="org-root/ls-sp11" dynamicConPolicyName="" extIPState="none" fltAggr="1" fsmDescr="" fsmFlags="" fsmPrev="ConfigureSuccess" fsmProgr="
100" fsmRmtInvErrCode="none" fsmRmtInvErrDescr="" fsmRmtInvRslt="" fsmStageDescr="" fsmStamp="2012-02-06T05:46:13.595" fsmStatus="nop" fsmTry="0" host
FwPolicyName="" identPoolName="" intId="186797" localDiskPolicyName="" maintPolicyName="" mgmtAccessPolicyName="" mgmtFwPolicyName="" name="sp11" oper
BiosProfileName="" operBootPolicyName="org-root/boot-policy-default" operDynamicConPolicyName="" operHostFwPolicyName="" operIdentPoolName="org-root/u
uid-pool-default" operLocalDiskPolicyName="org-root/local-disk-config-default" operMaintPolicyName="org-root/maint-default" operMgmtAccessPolicyName="
" operMgmtFwPolicyName="" operPowerPolicyName="org-root/power-policy-default" operScrubPolicyName="org-root/scrub-default" operSolPolicyName="" operSr
cTemplName="" operState="unassociated" operStatsPolicyName="org-root/thr-policy-default" operVconProfileName="" owner="management" pnDn="" powerPolicy
Name="default"  scrubPolicyName="" solPolicyName="" srcTemplName="" statsPolicyName="default"  type="instance" usrLbl="" uuid="derived" uuidSuffix="00
00-000000000000" vconProfileName=""/>  <lsServer agentPolicyName="" assignState="unassigned" assocState="unassociated" biosProfileName="" bootPolicyNa
me=""  configQualifier="insufficient-resources,mac-address-assignment" configState="failed-to-apply" descr="" dn="org-root/ls-test" dynamicConPolicyNa
me="" extIPState="none" fltAggr="4294967299" fsmDescr="Configuring Service Profile test(FSM:sam:dme:LsServerConfigure)" fsmFlags="sam:dme:LsServerConf
igure:modification" fsmPrev="ConfigureApplyIdentifiers" fsmProgr="45" fsmRmtInvErrCode="none" fsmRmtInvErrDescr="" fsmRmtInvRslt="" fsmStageDescr="Res
olving and applying identifiers(FSM-STAGE:sam:dme:LsServerConfigure:ApplyIdentifiers)" fsmStamp="2012-02-06T10:10:29.915" fsmStatus="ConfigureApplyIde
ntifiers" fsmTry="1" hostFwPolicyName="" identPoolName="" intId="186914" localDiskPolicyName="default" maintPolicyName="" mgmtAccessPolicyName="" mgmt
FwPolicyName="" name="test" operBiosProfileName="" operBootPolicyName="org-root/boot-policy-default" operDynamicConPolicyName="" operHostFwPolicyName=
"" operIdentPoolName="org-root/uuid-pool-default" operLocalDiskPolicyName="org-root/local-disk-config-default" operMaintPolicyName="org-root/maint-def
ault" operMgmtAccessPolicyName="" operMgmtFwPolicyName="" operPowerPolicyName="org-root/power-policy-default" operScrubPolicyName="org-root/scrub-defa
ult" operSolPolicyName="" operSrcTemplName="" operState="config-failure" operStatsPolicyName="org-root/thr-policy-default" operVconProfileName="" owne
r="management" pnDn="" powerPolicyName="default"  scrubPolicyName="" solPolicyName="default" srcTemplName="" statsPolicyName="default"  type="instance
" usrLbl="" uuid="12340000-0000-0000-0000-000000000000" uuidSuffix="0000-000000000000" vconProfileName=""/> </outConfigs> </configResolveClass>
 
 
 
 
PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba -xml
 
==>bgl-samc17:<configResolveClass classId="vnicFc" cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" inHierarchical="false"><inFilter><or><wcar
d class="vnicFc" property="dn" value="^org-root/ls-sp11/" /><wcard class="vnicFc" property="dn" value="^org-root/ls-test/" /></or></inFilter></configR
esolveClass>
 
<==bgl-samc17: <configResolveClass cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" response="yes" classId="vnicFc"> <outConfigs>  <vnicFc ada
ptorProfileName="" addr="20:00:00:25:B5:AA:AA:AA" adminVcon="any" bootDev="disabled"  configQualifier="" configState="not-applied" dn="org-root/ls-sp1
1/fc-hba1" equipmentDn="" fltAggr="0" identPoolName="" instType="manual" maxDataFieldSize="2048" name="hba1" nodeAddr="20:00:00:25:B5:BB:BB:BB" nwTemp
lName="" operAdaptorProfileName="org-root/fc-profile-default" operIdentPoolName="org-root/wwn-pool-default" operNwTemplName="" operOrder="1" operPinTo
GroupName="" operQosPolicyName="" operSpeed="line-rate" operStatsPolicyName="org-root/thr-policy-default" operVcon="any" order="1" owner="logical" per
sBind="disabled" persBindClear="no" pinToGroupName="" qosPolicyName=""  statsPolicyName="default"  switchId="A" type="fc"/>  <vnicFc adaptorProfileNam
e="" addr="20:00:00:25:B5DDD" adminVcon="any" bootDev="disabled"  configQualifier="" configState="not-applied" dn="org-root/ls-test/fc-vhba2" eq
uipmentDn="" fltAggr="0" identPoolName="" instType="manual" maxDataFieldSize="2048" name="vhba2" nodeAddr="20:00:00:25:B5:CC:CC:CC" nwTemplName="" ope
rAdaptorProfileName="org-root/fc-profile-default" operIdentPoolName="org-root/wwn-pool-default" operNwTemplName="" operOrder="unspecified" operPinToGr
oupName="" operQosPolicyName="" operSpeed="line-rate" operStatsPolicyName="org-root/thr-policy-default" operVcon="any" order="1" owner="logical" persB
ind="disabled" persBindClear="no" pinToGroupName="" qosPolicyName=""  statsPolicyName="default"  switchId="A" type="fc"/> </outConfigs> </configResolv
eClass>
 
 
PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba | Get-UcsVhbaInterface -xml
 
==>bgl-samc17:<configResolveClass classId="vnicFcIf" cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" inHierarchical="false"><inFilter><or><wc
ard class="vnicFcIf" property="dn" value="^org-root/ls-sp11/fc-hba1/" /><wcard class="vnicFcIf" property="dn" value="^org-root/ls-test/fc-vhba2/" /></
or></inFilter></configResolveClass>
 
<==bgl-samc17: <configResolveClass cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" response="yes" classId="vnicFcIf"> <outConfigs>  <vnicFcIf
  dn="org-root/ls-sp11/fc-hba1/if-default" initiator="20:00:00:25:B5:AA:AA:AA" name="default" operState="indeterminate" operVnetDn="fabric/san/net-def
ault" operVnetName="default" owner="logical"   switchId="A" type="fc" vnet="1"/>  <vnicFcIf  dn="org-root/ls-test/fc-vhba2/if-default" initiator="20:0
0:00:25:B5DDD" name="vsan2" operState="indeterminate" operVnetDn="fabric/san/net-vsan2" operVnetName="vsan2" owner="logical"   switchId="A" type
="fc" vnet="2"/> </outConfigs> </configResolveClass>
 
 
PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba | Get-UcsVhbaInterface | select Dn,Initiator,Vnet
 
Dn      Initiator   Vnet
--      ---------   ----
org-root/ls-sp11/fc-hba1/if-default  20:00:00:25:B5:AA:AA:AA  1
org-root/ls-test/fc-vhba2/if-default 20:00:00:25:B5DDD  2 
 
 
You can download the lastest version of Cisco UCS PowerTool 0.9.6.0 and Getting Started guide from
http://developer.cisco.com/web/unifiedcomputing/microsoft
 
 
Thanks,
Vijay Vikrant Balyan
 
 
 

Subject: RE: best way to query WWPN of all HBA
Replied by: Vijay Balyan on 06-02-2012 05:59:08 AM
If you make use of the Cisco UCS powertool 0.9.6.0, then the in-built Ucs Cmdlets will take care of forming and sending the xml query for you.

PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba | Get-UcsVhbaInterface | select Dn,Initiator,Vnet

Dn Initiator Vnet
-- --------- ----
org-root/ls-sp11/fc-hba1/if-default  20:00:00:25:B5:AA:AA:AA 1
org-root/ls-test/fc-vhba2/if-default 20:00:00:25:B5DDD 2


The -xml option gives us more details about the internal functioning of the cmdlet.
It shows us the query that was generated and sent when we executed the cmdlet and the response we received.

PS C:\> Get-UcsServiceProfile -type instance -xml

==>bgl-samc17:<configResolveClass classId="lsServer" cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" inHierarchical="false"><inFilter><and><e
q class="lsServer" property="type" value="instance" /><wcard class="lsServer" property="dn" value="^org-root/" /></and></inFilter></configResolveClass
>

<==bgl-samc17: <configResolveClass cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" response="yes" classId="lsServer"> <outConfigs>  <lsServer
agentPolicyName="" assignState="unassigned" assocState="unassociated" biosProfileName="" bootPolicyName=""  configQualifier="" configState="not-appli
ed" descr="" dn="org-root/ls-sp11" dynamicConPolicyName="" extIPState="none" fltAggr="1" fsmDescr="" fsmFlags="" fsmPrev="ConfigureSuccess" fsmProgr="
100" fsmRmtInvErrCode="none" fsmRmtInvErrDescr="" fsmRmtInvRslt="" fsmStageDescr="" fsmStamp="2012-02-06T05:46:13.595" fsmStatus="nop" fsmTry="0" host
FwPolicyName="" identPoolName="" intId="186797" localDiskPolicyName="" maintPolicyName="" mgmtAccessPolicyName="" mgmtFwPolicyName="" name="sp11" oper
BiosProfileName="" operBootPolicyName="org-root/boot-policy-default" operDynamicConPolicyName="" operHostFwPolicyName="" operIdentPoolName="org-root/u
uid-pool-default" operLocalDiskPolicyName="org-root/local-disk-config-default" operMaintPolicyName="org-root/maint-default" operMgmtAccessPolicyName="
" operMgmtFwPolicyName="" operPowerPolicyName="org-root/power-policy-default" operScrubPolicyName="org-root/scrub-default" operSolPolicyName="" operSr
cTemplName="" operState="unassociated" operStatsPolicyName="org-root/thr-policy-default" operVconProfileName="" owner="management" pnDn="" powerPolicy
Name="default"  scrubPolicyName="" solPolicyName="" srcTemplName="" statsPolicyName="default"  type="instance" usrLbl="" uuid="derived" uuidSuffix="00
00-000000000000" vconProfileName=""/>  <lsServer agentPolicyName="" assignState="unassigned" assocState="unassociated" biosProfileName="" bootPolicyNa
me=""  configQualifier="insufficient-resources,mac-address-assignment" configState="failed-to-apply" descr="" dn="org-root/ls-test" dynamicConPolicyNa
me="" extIPState="none" fltAggr="4294967299" fsmDescr="Configuring Service Profile test(FSM:sam:dme:LsServerConfigure)" fsmFlags="sam:dme:LsServerConf
igure:modification" fsmPrev="ConfigureApplyIdentifiers" fsmProgr="45" fsmRmtInvErrCode="none" fsmRmtInvErrDescr="" fsmRmtInvRslt="" fsmStageDescr="Res
olving and applying identifiers(FSM-STAGE:sam:dme:LsServerConfigure:ApplyIdentifiers)" fsmStamp="2012-02-06T10:10:29.915" fsmStatus="ConfigureApplyIde
ntifiers" fsmTry="1" hostFwPolicyName="" identPoolName="" intId="186914" localDiskPolicyName="default" maintPolicyName="" mgmtAccessPolicyName="" mgmt
FwPolicyName="" name="test" operBiosProfileName="" operBootPolicyName="org-root/boot-policy-default" operDynamicConPolicyName="" operHostFwPolicyName=
"" operIdentPoolName="org-root/uuid-pool-default" operLocalDiskPolicyName="org-root/local-disk-config-default" operMaintPolicyName="org-root/maint-def
ault" operMgmtAccessPolicyName="" operMgmtFwPolicyName="" operPowerPolicyName="org-root/power-policy-default" operScrubPolicyName="org-root/scrub-defa
ult" operSolPolicyName="" operSrcTemplName="" operState="config-failure" operStatsPolicyName="org-root/thr-policy-default" operVconProfileName="" owne
r="management" pnDn="" powerPolicyName="default"  scrubPolicyName="" solPolicyName="default" srcTemplName="" statsPolicyName="default"  type="instance
" usrLbl="" uuid="12340000-0000-0000-0000-000000000000" uuidSuffix="0000-000000000000" vconProfileName=""/> </outConfigs> </configResolveClass>




PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba -xml

==>bgl-samc17:<configResolveClass classId="vnicFc" cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" inHierarchical="false"><inFilter><or><wcar
d class="vnicFc" property="dn" value="^org-root/ls-sp11/" /><wcard class="vnicFc" property="dn" value="^org-root/ls-test/" /></or></inFilter></configR
esolveClass>

<==bgl-samc17: <configResolveClass cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" response="yes" classId="vnicFc"> <outConfigs>  <vnicFc ada
ptorProfileName="" addr="20:00:00:25:B5:AA:AA:AA" adminVcon="any" bootDev="disabled"  configQualifier="" configState="not-applied" dn="org-root/ls-sp1
1/fc-hba1" equipmentDn="" fltAggr="0" identPoolName="" instType="manual" maxDataFieldSize="2048" name="hba1" nodeAddr="20:00:00:25:B5:BB:BB:BB" nwTemp
lName="" operAdaptorProfileName="org-root/fc-profile-default" operIdentPoolName="org-root/wwn-pool-default" operNwTemplName="" operOrder="1" operPinTo
GroupName="" operQosPolicyName="" operSpeed="line-rate" operStatsPolicyName="org-root/thr-policy-default" operVcon="any" order="1" owner="logical" per
sBind="disabled" persBindClear="no" pinToGroupName="" qosPolicyName=""  statsPolicyName="default"  switchId="A" type="fc"/>  <vnicFc adaptorProfileNam
e="" addr="20:00:00:25:B5DDD" adminVcon="any" bootDev="disabled"  configQualifier="" configState="not-applied" dn="org-root/ls-test/fc-vhba2" eq
uipmentDn="" fltAggr="0" identPoolName="" instType="manual" maxDataFieldSize="2048" name="vhba2" nodeAddr="20:00:00:25:B5:CC:CC:CC" nwTemplName="" ope
rAdaptorProfileName="org-root/fc-profile-default" operIdentPoolName="org-root/wwn-pool-default" operNwTemplName="" operOrder="unspecified" operPinToGr
oupName="" operQosPolicyName="" operSpeed="line-rate" operStatsPolicyName="org-root/thr-policy-default" operVcon="any" order="1" owner="logical" persB
ind="disabled" persBindClear="no" pinToGroupName="" qosPolicyName=""  statsPolicyName="default"  switchId="A" type="fc"/> </outConfigs> </configResolv
eClass>


PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba | Get-UcsVhbaInterface -xml

==>bgl-samc17:<configResolveClass classId="vnicFcIf" cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" inHierarchical="false"><inFilter><or><wc
ard class="vnicFcIf" property="dn" value="^org-root/ls-sp11/fc-hba1/" /><wcard class="vnicFcIf" property="dn" value="^org-root/ls-test/fc-vhba2/" /></
or></inFilter></configResolveClass>

<==bgl-samc17: <configResolveClass cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" response="yes" classId="vnicFcIf"> <outConfigs>  <vnicFcIf
  dn="org-root/ls-sp11/fc-hba1/if-default" initiator="20:00:00:25:B5:AA:AA:AA" name="default" operState="indeterminate" operVnetDn="fabric/san/net-def
ault" operVnetName="default" owner="logical"   switchId="A" type="fc" vnet="1"/>  <vnicFcIf  dn="org-root/ls-test/fc-vhba2/if-default" initiator="20:0
0:00:25:B5DDD" name="vsan2" operState="indeterminate" operVnetDn="fabric/san/net-vsan2" operVnetName="vsan2" owner="logical"   switchId="A" type
="fc" vnet="2"/> </outConfigs> </configResolveClass>


PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba | Get-UcsVhbaInterface | select Dn,Initiator,Vnet

Dn Initiator Vnet
-- --------- ----
org-root/ls-sp11/fc-hba1/if-default  20:00:00:25:B5:AA:AA:AA 1
org-root/ls-test/fc-vhba2/if-default 20:00:00:25:B5DDD 2


You can download the lastest version of Cisco UCS PowerTool 0.9.6.0 and Getting Started guide from
http://developer.cisco.com/web/unifiedcomputing/microsoft


Thanks,
Vijay Vikrant Balyan

Subject: RE: best way to query WWPN of all HBA
Replied by: Dilip panwar on 06-02-2012 08:00:21 AM
As you said that there  are multiple ways so  thought i should confirm with template I am using.. :-)
I would prefer XML API as you are going to write scripts for same and XML API will be helpful for it and  cmdlets are mainly preferred for manual use and if u r still willing to use cmdlets for writing scripts I guess you have to use 'Expect' for this purpose

Subject: RE: best way to query WWPN of all HBA
Replied by: Dilip panwar on 06-02-2012 08:02:28 AM
If you make use of the Cisco UCS powertool 0.9.6.0, then the in-built Ucs Cmdlets will take care of forming and sending the xml query for you.

PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba | Get-UcsVhbaInterface | select Dn,Initiator,Vnet

Dn Initiator Vnet
-- --------- ----
org-root/ls-sp11/fc-hba1/if-default  20:00:00:25:B5:AA:AA:AA 1
org-root/ls-test/fc-vhba2/if-default 20:00:00:25:B5DDD 2


The -xml option gives us more details about the internal functioning of the cmdlet.
It shows us the query that was generated and sent when we executed the cmdlet and the response we received.

PS C:\> Get-UcsServiceProfile -type instance -xml

==>bgl-samc17:<configResolveClass classId="lsServer" cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" inHierarchical="false"><inFilter><and><e
q class="lsServer" property="type" value="instance" /><wcard class="lsServer" property="dn" value="^org-root/" /></and></inFilter></configResolveClass
>

<==bgl-samc17: <configResolveClass cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" response="yes" classId="lsServer"> <outConfigs>  <lsServer
agentPolicyName="" assignState="unassigned" assocState="unassociated" biosProfileName="" bootPolicyName=""  configQualifier="" configState="not-appli
ed" descr="" dn="org-root/ls-sp11" dynamicConPolicyName="" extIPState="none" fltAggr="1" fsmDescr="" fsmFlags="" fsmPrev="ConfigureSuccess" fsmProgr="
100" fsmRmtInvErrCode="none" fsmRmtInvErrDescr="" fsmRmtInvRslt="" fsmStageDescr="" fsmStamp="2012-02-06T05:46:13.595" fsmStatus="nop" fsmTry="0" host
FwPolicyName="" identPoolName="" intId="186797" localDiskPolicyName="" maintPolicyName="" mgmtAccessPolicyName="" mgmtFwPolicyName="" name="sp11" oper
BiosProfileName="" operBootPolicyName="org-root/boot-policy-default" operDynamicConPolicyName="" operHostFwPolicyName="" operIdentPoolName="org-root/u
uid-pool-default" operLocalDiskPolicyName="org-root/local-disk-config-default" operMaintPolicyName="org-root/maint-default" operMgmtAccessPolicyName="
" operMgmtFwPolicyName="" operPowerPolicyName="org-root/power-policy-default" operScrubPolicyName="org-root/scrub-default" operSolPolicyName="" operSr
cTemplName="" operState="unassociated" operStatsPolicyName="org-root/thr-policy-default" operVconProfileName="" owner="management" pnDn="" powerPolicy
Name="default"  scrubPolicyName="" solPolicyName="" srcTemplName="" statsPolicyName="default"  type="instance" usrLbl="" uuid="derived" uuidSuffix="00
00-000000000000" vconProfileName=""/>  <lsServer agentPolicyName="" assignState="unassigned" assocState="unassociated" biosProfileName="" bootPolicyNa
me=""  configQualifier="insufficient-resources,mac-address-assignment" configState="failed-to-apply" descr="" dn="org-root/ls-test" dynamicConPolicyNa
me="" extIPState="none" fltAggr="4294967299" fsmDescr="Configuring Service Profile test(FSM:sam:dme:LsServerConfigure)" fsmFlags="sam:dme:LsServerConf
igure:modification" fsmPrev="ConfigureApplyIdentifiers" fsmProgr="45" fsmRmtInvErrCode="none" fsmRmtInvErrDescr="" fsmRmtInvRslt="" fsmStageDescr="Res
olving and applying identifiers(FSM-STAGE:sam:dme:LsServerConfigure:ApplyIdentifiers)" fsmStamp="2012-02-06T10:10:29.915" fsmStatus="ConfigureApplyIde
ntifiers" fsmTry="1" hostFwPolicyName="" identPoolName="" intId="186914" localDiskPolicyName="default" maintPolicyName="" mgmtAccessPolicyName="" mgmt
FwPolicyName="" name="test" operBiosProfileName="" operBootPolicyName="org-root/boot-policy-default" operDynamicConPolicyName="" operHostFwPolicyName=
"" operIdentPoolName="org-root/uuid-pool-default" operLocalDiskPolicyName="org-root/local-disk-config-default" operMaintPolicyName="org-root/maint-def
ault" operMgmtAccessPolicyName="" operMgmtFwPolicyName="" operPowerPolicyName="org-root/power-policy-default" operScrubPolicyName="org-root/scrub-defa
ult" operSolPolicyName="" operSrcTemplName="" operState="config-failure" operStatsPolicyName="org-root/thr-policy-default" operVconProfileName="" owne
r="management" pnDn="" powerPolicyName="default"  scrubPolicyName="" solPolicyName="default" srcTemplName="" statsPolicyName="default"  type="instance
" usrLbl="" uuid="12340000-0000-0000-0000-000000000000" uuidSuffix="0000-000000000000" vconProfileName=""/> </outConfigs> </configResolveClass>




PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba -xml

==>bgl-samc17:<configResolveClass classId="vnicFc" cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" inHierarchical="false"><inFilter><or><wcar
d class="vnicFc" property="dn" value="^org-root/ls-sp11/" /><wcard class="vnicFc" property="dn" value="^org-root/ls-test/" /></or></inFilter></configR
esolveClass>

<==bgl-samc17: <configResolveClass cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" response="yes" classId="vnicFc"> <outConfigs>  <vnicFc ada
ptorProfileName="" addr="20:00:00:25:B5:AA:AA:AA" adminVcon="any" bootDev="disabled"  configQualifier="" configState="not-applied" dn="org-root/ls-sp1
1/fc-hba1" equipmentDn="" fltAggr="0" identPoolName="" instType="manual" maxDataFieldSize="2048" name="hba1" nodeAddr="20:00:00:25:B5:BB:BB:BB" nwTemp
lName="" operAdaptorProfileName="org-root/fc-profile-default" operIdentPoolName="org-root/wwn-pool-default" operNwTemplName="" operOrder="1" operPinTo
GroupName="" operQosPolicyName="" operSpeed="line-rate" operStatsPolicyName="org-root/thr-policy-default" operVcon="any" order="1" owner="logical" per
sBind="disabled" persBindClear="no" pinToGroupName="" qosPolicyName=""  statsPolicyName="default"  switchId="A" type="fc"/>  <vnicFc adaptorProfileNam
e="" addr="20:00:00:25:B5DDD" adminVcon="any" bootDev="disabled"  configQualifier="" configState="not-applied" dn="org-root/ls-test/fc-vhba2" eq
uipmentDn="" fltAggr="0" identPoolName="" instType="manual" maxDataFieldSize="2048" name="vhba2" nodeAddr="20:00:00:25:B5:CC:CC:CC" nwTemplName="" ope
rAdaptorProfileName="org-root/fc-profile-default" operIdentPoolName="org-root/wwn-pool-default" operNwTemplName="" operOrder="unspecified" operPinToGr
oupName="" operQosPolicyName="" operSpeed="line-rate" operStatsPolicyName="org-root/thr-policy-default" operVcon="any" order="1" owner="logical" persB
ind="disabled" persBindClear="no" pinToGroupName="" qosPolicyName=""  statsPolicyName="default"  switchId="A" type="fc"/> </outConfigs> </configResolv
eClass>


PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba | Get-UcsVhbaInterface -xml

==>bgl-samc17:<configResolveClass classId="vnicFcIf" cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" inHierarchical="false"><inFilter><or><wc
ard class="vnicFcIf" property="dn" value="^org-root/ls-sp11/fc-hba1/" /><wcard class="vnicFcIf" property="dn" value="^org-root/ls-test/fc-vhba2/" /></
or></inFilter></configResolveClass>

<==bgl-samc17: <configResolveClass cookie="1328522891/149f3955-d9f4-460f-bac1-c6458fd9379c" response="yes" classId="vnicFcIf"> <outConfigs>  <vnicFcIf
  dn="org-root/ls-sp11/fc-hba1/if-default" initiator="20:00:00:25:B5:AA:AA:AA" name="default" operState="indeterminate" operVnetDn="fabric/san/net-def
ault" operVnetName="default" owner="logical"   switchId="A" type="fc" vnet="1"/>  <vnicFcIf  dn="org-root/ls-test/fc-vhba2/if-default" initiator="20:0
0:00:25:B5DDD" name="vsan2" operState="indeterminate" operVnetDn="fabric/san/net-vsan2" operVnetName="vsan2" owner="logical"   switchId="A" type
="fc" vnet="2"/> </outConfigs> </configResolveClass>


PS C:\> Get-UcsServiceProfile -type instance | Get-UcsVhba | Get-UcsVhbaInterface | select Dn,Initiator,Vnet

Dn Initiator Vnet
-- --------- ----
org-root/ls-sp11/fc-hba1/if-default  20:00:00:25:B5:AA:AA:AA 1
org-root/ls-test/fc-vhba2/if-default 20:00:00:25:B5DDD 2


You can download the lastest version of Cisco UCS PowerTool 0.9.6.0 and Getting Started guide from
http://developer.cisco.com/web/unifiedcomputing/microsoft


Thanks,
Vijay Vikrant Balyan

 
 
Is this tool is platform independent?

Subject: RE: best way to query WWPN of all HBA
Replied by: Eric Williams on 06-02-2012 10:48:50 AM
Powershell is a scripting language based on .NET and is not platform independent.  It's a tool written by Microsoft.  Cisco has developed a PowerShell provider called Cisco UCS PowerTool, that is written to take advantage of Microsoft Powershell.

Subject: RE: best way to query WWPN of all HBA
Replied by: Eric Williams on 06-02-2012 10:50:18 AM
I do not have any issues generating the required XML I am just wondering what would be the best approach. Furthermore I don't think those cmdlets will run very well on my linux management station.

If you are a linux user, you should look at goUCS.  We are about to release goUCS for Linux.  I can send you a copy of a release candidate we have on linux, if you would like to try it out.  Email me at goucs@cisco.com

Subject: RE: best way to query WWPN of all HBA
Replied by: Dilip panwar on 06-02-2012 03:47:18 AM
<configResolveClass classId="lsServer" cookie="" inHierarchical="false"> </configResolveClass>
get all the DN's from above response
then for each 'dn' fire the below query-
1<configResolveClass classId="lsServer" cookie="" inHierarchical="false">
2    <inFilter>
3        <eq class="lsServer" property="dn" value="<dn_value>"/>
4    </inFilter>
5</configResolveClass>

Now use the below xpath to value of type 'attribute'
/configResolveClass/outConfigs/lsServer

if the 'type' is 'instance' then save the 'dn' in Service Profile list

Now foreach Service Profile 'dn' fire the below query-
   
1 <configResolveDn inHierarchical="true"
2    cookie=""
3     dn="org-root/ls-11" >
4</configResolveDn>

Now use the below xpath to get all the vNICFC (you will get  the vNicFcEther Node List and blank incase there is no node available)
/configResolveDn/outConfig/lsServer/vnicFc

Now for each vNicFc Ether Node

search for "name" attribute to get the vNicFc Name
After then fetch the child nodes of this vnicFc
then for each child Node
get the child nodeName
if it is 'vnicFcIf'
then search for attribute 'initiator' whose value is the WWPN of a that vNIC FC

Subject: RE: best way to query WWPN of all HBA
Replied by: Dilip panwar on 06-02-2012 03:54:11 AM
I hope that above approach would  be helpful Though please let me know if you have got the better way to get the same

Thanks
Dilip

Subject: RE: best way to query WWPN of all HBA
Replied by: EELCO NIEUWSTAD on 06-02-2012 04:35:38 AM
Why would you get first the DN and then get all the info for that while you can do it one query by doing a configResolveClass with a filter?
At the moment I have written all the Perl code to get all the relevant server info in a Perl XML object. I can retrieve everything I want but I was wonder if my approch would be the quickes/most efficient. When I am back at home I will post my queries to show how my script has been done.

BTW I think I will integrate it with a script which can instantiate profiles from templates. For some reason there are more options to create profiles with the XML interface that with the GUI.

Subject: RE: best way to query WWPN of all HBA
Replied by: Dilip panwar on 06-02-2012 04:57:27 AM
Yeah, if we see from requirement view.. we can do that in a single query. Apart of it, if I am correct then there is only one XML API available to   instantiate profiles from template.
1<lsInstantiateNTemplate dn="" cookie="" inTargetOrg=""
2inServerNamePrefixOrEmpty="" inNumberOf="" inHierarchical="no">
3</lsInstantiateNTemplate>


Subject: RE: best way to query WWPN of all HBA
Replied by: Dilip panwar on 06-02-2012 05:01:49 AM
Yeah, if we see from requirement view.. we can do that in a single query. Apart of it, if I am correct then there is only one XML API available to   instantiate profiles from template.
1<lsInstantiateNTemplate dn="" cookie="" inTargetOrg=""
2inServerNamePrefixOrEmpty="" inNumberOf="" inHierarchical="no">
3</lsInstantiateNTemplate>


.Below is the updated one
 
lsInstantiateNTemplate dn="" cookie="" inTargetOrg=""
inServerNamePrefixOrEmpty="" inNumberOf="">
</lsInstantiateNTemplate>

Subject: RE: best way to query WWPN of all HBA
Replied by: EELCO NIEUWSTAD on 06-02-2012 05:56:46 AM
From the UCS XML API Reference
 1
 2lsInstantiateNNamedTemplate
 3XML API reference
 4For a specified service template, the lsInstantiateNNamedTemplate method instantiates as many service profiles as are specified in the namedSet parameter.
 5
 6¿dn¿Specifies the service template used for instantiating.
 7
 8¿nameSet¿Contains the names of the service profiles to be instantiated.
 9
10¿targetOrg¿Specifies the organization in which these service profiles are instantiated.

1
2lsInstantiateNTemplate
3
4The lsInstantiateNTemplate method creates a number (N) of service profiles from a template.

1
2lsInstantiateTemplate
3
4The lsInstantiateTemplate method creates one service profile from a specified template.


the first and last one allows you to create profiles in line with your company naming conventions. The one in the GUI forces you to accept a number suffix even when creating a single profile.

Subject: RE: best way to query WWPN of all HBA
Replied by: EELCO NIEUWSTAD on 06-02-2012 06:50:25 AM
I do not have any issues generating the required XML I am just wondering what would be the best approach. Furthermore I don't think those cmdlets will run very well on my linux management station.

Subject: RE: best way to query WWPN of all HBA
Replied by: Hieu Nguyen on 05-06-2013 12:57:13 PM
 I'm uncessfuly trying to query WWPN on UCS chassis using Cisco UCS Manager XML API, could you please post your script
Thanks

Subject: RE: best way to query WWPN of all HBA
Replied by: Luke Poskitt on 06-06-2013 06:44:16 PM
EELCO NIEUWSTAD:
Because I find it very boring (and I am lazy) to create aliases and zones for all HBA's of my server profiles in my MDS switch I would like to write a script to do it for me.
Hi Eelco, rather than generate zones based on deployed server profiles you could pre-generate the MDS zone configuration based on the WWNN and WWPN pools configured for your service profiles. 

That is; when you create your service profile or vHBA template, you specify the VSAN attachment and the WWPN/WWNN pool - knowing which WWNNs/WWPNs will be used for each VSAN, you can then pre-generate your MDS zoning configuration so that any newly deployed service profiles will have vHBAs with pre-zoned connectivity.

This is especially useful if you are booting from SAN as it allows you to deploy a service profile with SAN connectivity rather than deploy a service profile, determine the WWPNs used, and then create the zoning configuration.  As long as you have a sane WWPN allocation strategy for your service profiles with plenty of sequential WWPN headroom, you can then also easily extend your zoning configuration to accomodate any number of pre-zoned hosts.

Subject: RE: best way to query WWPN of all HBA
Replied by: Sage Harvey on 07-06-2013 08:45:23 AM
Luke Poskitt:
EELCO NIEUWSTAD:
Because I find it very boring (and I am lazy) to create aliases and zones for all HBA's of my server profiles in my MDS switch I would like to write a script to do it for me.
rather than generate zones based on deployed server profiles you could pre-generate the MDS zone configuration based on the WWNN and WWPN pools configured for your service profiles.

This.  Because we can create and assign the boot luns ahead of time, I can create boot luns and install OS's for servers I don't actually have yet.  For example, if I've got 8 blades but I know the environment is going to grow to 32.  I can generate all 32 service profiles, create boot luns and then swap service profiles doing full installations on each LUN.

When I'm done, I switch back to the 8 I want to use now and when the new blades arrive, I can assign them where needed and the OS is ready to go.  You could even pre-assign the service profiles to chassis / blade locations ahead of time and they'll just pop into the right place when the gear arrives.

Subject: RE: best way to query WWPN of all HBA
Replied by: Sage Harvey on 07-06-2013 08:49:10 AM
RE: best way to query WWPN of all HBA

Subject: RE: best way to query WWPN of all HBA
Replied by: Sage Harvey on 07-06-2013 08:51:32 AM
Luke Poskitt:
EELCO NIEUWSTAD:
Because I find it very boring (and I am lazy) to create aliases and zones for all HBA's of my server profiles in my MDS switch I would like to write a script to do it for me.
Hi Eelco, rather than generate zones based on deployed server profiles you could pre-generate the MDS zone configuration based on the WWNN and WWPN pools configured for your service profiles. 


This.  Because we can create and assign the boot luns ahead of time, I can create boot luns and install OS's for servers I don't actually have yet.  For example, if I've got 8 blades but I know the environment is going to grow to 32.  I can generate all 32 service profiles, create boot luns and then swap service profiles doing full installations on each LUN.

When I'm done, I switch back to the 8 I want to use now and when the new blades arrive, I can assign them where needed and the OS is ready to go.  You could even pre-assign the service profiles to chassis / blade locations ahead of time and they'll just pop into the right place when the gear arrives.

Sage
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:


This community is intended for developer topics around Data Center technology and products. If you are looking for a non-developer topic about Data Center, you might find additional information in the Data Center and Cloud community