VMware Cloud Community
f10
Expert
Expert

Cannot see the complete output using PowerCLI

Hello All,

I am new to PowerCLI and just trying few commands but I have noticed that often the output gets truncated when I open the vSphere CLI from the command prompt in windows. Here is an example

C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-

ScsiLun -VmHost (Get-VmHost 10.112.96.17) -LunType disk

CanonicalN ConsoleDeviceName LunType CapacityMB MultipathPolicy

ame

-


-


-


-


-


naa.600... /vmfs/devices/disks/naa.600... disk 279964 Fixed

naa.600... /vmfs/devices/disks/naa.600... disk 51200 MostRecently...

naa.600... /vmfs/devices/disks/naa.600... disk 51200 MostRecently...

What do I have to do so that I can see the complete Cannonical Name and Console Device Name ?

Thanks in advance,

f10

VCP3, VCP4, HPCP, HP UX CSA

Regards, Arun Pandey VCP 3,4,5 | VCAP-DCA | NCDA | HPUX-CSA | http://highoncloud.blogspot.in/ If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
5 Replies
avlieshout
VMware Employee
VMware Employee

You can change the width of your console.

You can use the format-table cmdlet with the -autosize switch

Get-VMHost | ft -autosize

Or use the Format-List cmdlet

Get-VMHost | fl

Arnim

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".
bulletp31
Enthusiast
Enthusiast

You can also just output to a CSV?

Export-csv output\location\name.csv

f10
Expert
Expert

Thanks for the prompt reply.

I have tried ft -autosize and here is what I get.

WARNING: 3 columns do not fit into the display and were removed.

CanonicalName ConsoleDeviceName

-


-


naa.600508b1001037383941424344450500 /vmfs/devices/disks/naa.600508b10010373...

naa.60060160582017005c0a006277b6df11 /vmfs/devices/disks/naa.600601605820170...

naa.60060160582017005d0a006277b6df11 /vmfs/devices/disks/naa.600601605820170...

are there any settings by which I can increase the size of the PowerCLI window ?

I would also appreciate if you could help me with the commands used to correlate the LUN Number its Canonical Name and Console Device Name and block device name. Can we also run the fidisk command remotely using PowerCLI to get the partition information ?

Thanks in advance !

f10,

VCP3, VCP4, HPCP, HP UX CSA

Regards, Arun Pandey VCP 3,4,5 | VCAP-DCA | NCDA | HPUX-CSA | http://highoncloud.blogspot.in/ If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
bulletp31
Enthusiast
Enthusiast

if you right click on the top tool bar and go properties, you can set the size of the Window.

you cant get any partition information from Power-CLI. I am affraid this is currently a limitation. none of the fdisk or vdf commands work.

As for getting the output you want, I would suggest piping to a CSV or HTML to formatt the output.

0 Kudos
avlieshout
VMware Employee
VMware Employee

Use the Select-Object cmdlet to select only the properties you're interested in.

The lunnumber is the last number in the canonical name which can be retrieved using the string's split() method.

try:

Get-ScsiLun -VmHost (Get-VmHost 10.112.96.17) -LunType disk | Select @{N="Lun";E={$_.canonicalname.split(":")[2]}}, CanonicalName, ConsoleDeviceName | ft -AutoSize

There's no native PowerCLI possibility to run COS commands. Also block devicenames (I suppose you mean /dev/sda etc) are given by the COS and are not available through the vmkernel.

-


Arnim van Lieshout

Blogging: http://www.van-lieshout.com

Twitter: http://www.twitter.com/avlieshout

If you find this information useful, please award points for "correct" or "helpful".

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".
0 Kudos