Hi WscholzWscholz, thank youf ro your answer.
Unfortunately I am not a NetApp customer, and I have been working with a powerCLI script to grab the information from a LINUX VM. Below is the initial part of the code, but, for some reason the PowerCLI does not like the "double-quotes" nomenclature of the fdisk command presented below, then it has been failing. It is interesting because if I copy and part the fdisk command listed below on a LINUX shell, it will work fine! See below:
FDISK command executed from a LINUX VM shell:
/sbin/fdisk -lu /dev/sd[a-z] | grep -E sd[a-z][0-9]+ | sed s/*// | awk '{printf ("%s %f ",$1,$2/512); if($2%512){ print "PARTITION IS NOT ALIGNED!" }else {print "PARTITION IS ALIGNED!"} }' | column -t
/dev/sda1 4.000000 PARTITION IS ALIGNED!
/dev/sda2 2004.000000 PARTITION IS ALIGNED!
PowerCLI code part:
$toolsStatus = (Get-VM $vm | Get-View).Guest.ToolsStatus
if($toolsStatus -eq "toolsOk"){
Write-Host "VMware Tools is Installed!"
$script = "/sbin/fdisk -lu /dev/sd[a-z] | grep -E sd[a-z][0-9]+ | sed s/*// | awk '{printf ("%s %f ",$1,$2/512); if($2%512){ print "PARTITION IS NOT ALIGNED!" }else {print "PARTITION IS ALIGNED!"} }' | column -t"
Invoke-VMScript -VM $vm -ScriptText $script -GuestCredential $gc
}else{
Write-Host "Virtual Machine $vm is not operational or it does not have VMware Tools Installed. Virtual Machine partitions can not be aligned. Please check virtual machine $vm status or install VMware Tools before proceeding!!!" -ForegroundColor Red
exit
}
PowerCLI output (ERROR)
You must provide a value expression on the right-hand side of the '%' operator.
At C:\\invoke.ps1:19 char:101
+ $script = "/sbin/fdisk -lu /dev/sd[a-z] | grep -E sd[a-z][0-9]+ | sed s/
*// | awk '{printf ("% <<<< s %f ",$1,$2/512); if($2%512){ print "PARTITION IS
NOT ALIGNED!" }else {print "PARTITION IS ALIGNED!"} }' | column -t"
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : ExpectedValueExpression
Have you guys seem something similar?
Any help is really appreciated! tks