Comment

Hi, I have now got a bit furtther.  I created new accounts on nearly all of our hosts and the script begins to run but still generates errors but the script continues to run. However when the scripts completes it provides the names of the guests located in the LUN specified but does not provide any IOPs output.  Errors are below.

+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-Datastore : 10/11/2011 09:50:58    Get-Datastore        Could not find any
of the servers specified by name.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-VM : 10/11/2011 09:50:58    Get-VM        Could not find VIServer with name
'sose0003v.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
Get-VM : 10/11/2011 09:50:58    Get-VM        Could not find any of the servers
specified by name.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
You cannot call a method on a null-valued expression.
At C:\scripts\GatherIOPS.ps1:68 char:28
+         if ($stat.instance.Equals( <<<< $myDatastoreID)) {
The operation '[System.Int32] / [System.String]' is not defined.
At C:\scripts\GatherIOPS.ps1:78 char:27
+     return [int] ($totalIOPS/$ <<<< samples/20)
Method invocation failed because [System.String] doesn't contain a method named
'op_Division'.
At C:\scripts\GatherIOPS.ps1:94 char:50
+       $data."Interval (minutes)" = ($numsamples*20)/6 <<<< 0
Connect-VIServer : A parameter cannot be found that matches parameter name 'War
ningAction'.
At C:\scripts\GatherIOPS.ps1:58 char:86
+     connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa
rningAction  <<<< SilentlyContinue | Out-Null
Get-Datastore : 10/11/2011 09:50:59    Get-Datastore        Could not find VISe
rver with name 'sose0003v.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-Datastore : 10/11/2011 09:50:59    Get-Datastore        Could not find any
of the servers specified by name.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-VM : 10/11/2011 09:50:59    Get-VM        Could not find VIServer with name
'sose0003v.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
Get-VM : 10/11/2011 09:50:59    Get-VM        Could not find any of the servers
specified by name.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
You cannot call a method on a null-valued expression.
At C:\scripts\GatherIOPS.ps1:68 char:28
+         if ($stat.instance.Equals( <<<< $myDatastoreID)) {
The operation '[System.Int32] / [System.String]' is not defined.
At C:\scripts\GatherIOPS.ps1:78 char:27
+     return [int] ($totalIOPS/$ <<<< samples/20)
Connect-VIServer : A parameter cannot be found that matches parameter name 'War
ningAction'.
At C:\scripts\GatherIOPS.ps1:58 char:86
+     connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa
rningAction  <<<< SilentlyContinue | Out-Null
Get-Datastore : 10/11/2011 09:50:59    Get-Datastore        Could not find VISe
rver with name 'sose0003v.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-Datastore : 10/11/2011 09:50:59    Get-Datastore        Could not find any
of the servers specified by name.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-VM : 10/11/2011 09:50:59    Get-VM        Could not find VIServer with name
'sose0003v.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
Get-VM : 10/11/2011 09:50:59    Get-VM        Could not find any of the servers
specified by name.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
You cannot call a method on a null-valued expression.
At C:\scripts\GatherIOPS.ps1:68 char:28
+         if ($stat.instance.Equals( <<<< $myDatastoreID)) {
The operation '[System.Int32] / [System.String]' is not defined.
At C:\scripts\GatherIOPS.ps1:78 char:27
+     return [int] ($totalIOPS/$ <<<< samples/20)
Method invocation failed because [System.String] doesn't contain a method named
'op_Division'.
At C:\scripts\GatherIOPS.ps1:94 char:50
+       $data."Interval (minutes)" = ($numsamples*20)/6 <<<< 0
Connect-VIServer : A parameter cannot be found that matches parameter name 'War
ningAction'.
At C:\scripts\GatherIOPS.ps1:58 char:86
+     connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa
rningAction  <<<< SilentlyContinue | Out-Null
Get-Datastore : 10/11/2011 09:51:00    Get-Datastore        Could not find VISe
rver with name 'sose0003v.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-Datastore : 10/11/2011 09:51:00    Get-Datastore        Could not find any
of the servers specified by name.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-VM : 10/11/2011 09:51:00    Get-VM        Could not find VIServer with name
'sose0003v.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
Get-VM : 10/11/2011 09:51:00    Get-VM        Could not find any of the servers
specified by name.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
You cannot call a method on a null-valued expression.
At C:\scripts\GatherIOPS.ps1:68 char:28
+         if ($stat.instance.Equals( <<<< $myDatastoreID)) {
The operation '[System.Int32] / [System.String]' is not defined.
At C:\scripts\GatherIOPS.ps1:78 char:27
+     return [int] ($totalIOPS/$ <<<< samples/20)
Connect-VIServer : A parameter cannot be found that matches parameter name 'War
ningAction'.
At C:\scripts\GatherIOPS.ps1:58 char:86
+     connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa
rningAction  <<<< SilentlyContinue | Out-Null
Get-Datastore : 10/11/2011 09:51:00    Get-Datastore        Could not find VISe
rver with name 'sose0003v.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-Datastore : 10/11/2011 09:51:00    Get-Datastore        Could not find any
of the servers specified by name.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-VM : 10/11/2011 09:51:00    Get-VM        Could not find VIServer with name
'sose0003v.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
Get-VM : 10/11/2011 09:51:00    Get-VM        Could not find any of the servers
specified by name.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
You cannot call a method on a null-valued expression.
At C:\scripts\GatherIOPS.ps1:68 char:28
+         if ($stat.instance.Equals( <<<< $myDatastoreID)) {
The operation '[System.Int32] / [System.String]' is not defined.
At C:\scripts\GatherIOPS.ps1:78 char:27
+     return [int] ($totalIOPS/$ <<<< samples/20)
Method invocation failed because [System.String] doesn't contain a method named
'op_Division'.
At C:\scripts\GatherIOPS.ps1:94 char:50
+       $data."Interval (minutes)" = ($numsamples*20)/6 <<<< 0
Connect-VIServer : A parameter cannot be found that matches parameter name 'War
ningAction'.
At C:\scripts\GatherIOPS.ps1:58 char:86
+     connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa
rningAction  <<<< SilentlyContinue | Out-Null
Get-Datastore : 10/11/2011 09:51:01    Get-Datastore        Could not find VISe
rver with name 's0011dev.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-Datastore : 10/11/2011 09:51:01    Get-Datastore        Could not find any
of the servers specified by name.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-VM : 10/11/2011 09:51:01    Get-VM        Could not find VIServer with name
's0011dev.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
Get-VM : 10/11/2011 09:51:01    Get-VM        Could not find any of the servers
specified by name.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
You cannot call a method on a null-valued expression.
At C:\scripts\GatherIOPS.ps1:68 char:28
+         if ($stat.instance.Equals( <<<< $myDatastoreID)) {
The operation '[System.Int32] / [System.String]' is not defined.
At C:\scripts\GatherIOPS.ps1:78 char:27
+     return [int] ($totalIOPS/$ <<<< samples/20)
Connect-VIServer : A parameter cannot be found that matches parameter name 'War
ningAction'.
At C:\scripts\GatherIOPS.ps1:58 char:86
+     connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa
rningAction  <<<< SilentlyContinue | Out-Null
Get-Datastore : 10/11/2011 09:51:01    Get-Datastore        Could not find VISe
rver with name 's0011dev.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-Datastore : 10/11/2011 09:51:01    Get-Datastore        Could not find any
of the servers specified by name.
At C:\scripts\GatherIOPS.ps1:61 char:34
+     $myDatastoreID = ((Get-Datastore  <<<< $ds -server $vmhost) | Get-View).i
nfo.vmfs.extent[0].diskname
Get-VM : 10/11/2011 09:51:01    Get-VM        Could not find VIServer with name
's0011dev.scotland.gov.uk'.
At C:\scripts\GatherIOPS.ps1:64 char:40
+     $rawVMStats = get-stat -entity    (get-vm  <<<< $vm -server $vmhost) -sta
t $stat -maxSamples $samples
Get-VM : 10/11/2011 09:51:01    Get-VM        Could not find any of the servers
specified by name.
At C:\scripts\GatherIOPS.ps1:64 char:40