NucleusVM's Posts

worked like a charm. good info. Thank  you very much!
I am using this command to pull specific properties from all the vmguests in vCenter. $vms = Get-View -Server $vcenter -ViewType VirtualMachine -Property Name,Config,Snapshot,Summary,CustomVa... See more...
I am using this command to pull specific properties from all the vmguests in vCenter. $vms = Get-View -Server $vcenter -ViewType VirtualMachine -Property Name,Config,Snapshot,Summary,CustomValue,Guest,Runtime.Host,AvailableField,Value,Parent I want to use the same command against a specific list of vmguests listed in a text file. I don't want to use Get-VM because it's too slow. So I tried something like this, but it's not working. $computers = Get-Content "$PSScriptRoot\computers.txt" $vms = Get-View -Filter @{"Name" = $computers} -Server $vcenter -ViewType VirtualMachine -Property Name,Config,Snapshot,Summary,CustomValue,Guest,Runtime.Host,AvailableField,Value,Parent How can I run the Get-View command against a specific list of vmguests? Thanks
I just discovered that this is an issue with the specific guest (not that it justifies the error), so I'll just rebuild the machine from template.
I did this esxcli software vib update -v http://download3.vmware.com/software/vmw-tools/esxui/esxui-signed-8122819.vib the installation was successful, I restarted the ESXi, but the probl... See more...
I did this esxcli software vib update -v http://download3.vmware.com/software/vmw-tools/esxui/esxui-signed-8122819.vib the installation was successful, I restarted the ESXi, but the problem remains. And now, I don't even have the option to view the details of the error.
on the esxi web interface, when clicking "edit settings" on a guest, I get the following error. When I click on the "Details" button I get this. This is the esxi version I'm... See more...
on the esxi web interface, when clicking "edit settings" on a guest, I get the following error. When I click on the "Details" button I get this. This is the esxi version I'm using And I'm using the latest Chrome Any way to fix this? Thanks
For various reasons, I have a list of vmguests that don't have vmtools installed. I want to somehow automate the process of installing vmtools on them, but it's a bit difficult because I can't us... See more...
For various reasons, I have a list of vmguests that don't have vmtools installed. I want to somehow automate the process of installing vmtools on them, but it's a bit difficult because I can't use powercli commands in the vmguest operating system. (Linux or windows) I was thinking psexec and plink but I was wondering if there was a better, more efficient way of doing this. Keep in mind this is not for updating vmtools. I need to install vmtools on a vmguest, remotely and silently. How would you do this?
When running this script, I connect on 2 vcenters. Some of the hosts, report their cluster to be on vcenterA, when the host itself is located in vCenterB. It could be that some values match on bo... See more...
When running this script, I connect on 2 vcenters. Some of the hosts, report their cluster to be on vcenterA, when the host itself is located in vCenterB. It could be that some values match on both vCenters?
I am using this code (courtesy of LucD) to find a cluster's parent. $cl = Get-View -ViewType ClusterComputeResource -Property Name,Parent $dc = Get-View -Id (Get-view -Id $cl.Parent -Propert... See more...
I am using this code (courtesy of LucD) to find a cluster's parent. $cl = Get-View -ViewType ClusterComputeResource -Property Name,Parent $dc = Get-View -Id (Get-view -Id $cl.Parent -Property Name,Parent).Parent -Property Name $dc.Name I want to modify this in a way that it will give me a host's parent. I tried it like this, but no luck, because $cluster.name is always "host" $hosts = Get-View -ViewType HostSystem -Property Name,Parent $cluster = Get-View -Id (Get-view -Id $hosts.Parent -Property Name,Parent).Parent -Property Name $cluster.Name How can I achieve this?
Hello Using powercli, preferably get-view (because of the speed), what is the fastest way of finding out, in which cluster a vm is located? I'll be processing 3000 machines, so I need a way t... See more...
Hello Using powercli, preferably get-view (because of the speed), what is the fastest way of finding out, in which cluster a vm is located? I'll be processing 3000 machines, so I need a way to do this fast. Thanks
Any variables defined inside $script, are not working. Any workaround?
it worked. thanks!
I have a csv with 2 columns. First column is a list of vmguest names and the second is an annotation I want to add to those vmguests. I basically want to add a unique key for each vmguest. So I'm... See more...
I have a csv with 2 columns. First column is a list of vmguest names and the second is an annotation I want to add to those vmguests. I basically want to add a unique key for each vmguest. So I'm using this script. csv file vmguestname,vmguestkey name1,key1 name2,key2 name3,key3 script $csv = (Import-Csv "annotations.csv") $vmguestkey = ($csv.vmguestkey) $vmguestname = ($csv.vmguestname) foreach ($computer in $vmguestname){ Set-Annotation-Entity $computer -CustomAttribute "Key" -Value $vmguestkey } When I run the script I get a message Set-Annotation : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Value'. Specified method is not supported. Any idea what could I be doing wrong?
I need to find a VM Guest's last boot time. The machine running the PowerCli script and the VMGuest are on the same vCenter, but in isolated network segments. So I can't use Powershell to run Get... See more...
I need to find a VM Guest's last boot time. The machine running the PowerCli script and the VMGuest are on the same vCenter, but in isolated network segments. So I can't use Powershell to run Get-WmiObject or Get-CimInstance. And I would really prefer to avoid Invoke-VMscript. I haven't had much luck with it. How can I get a VMGuest's last boot time by using PowerCli cmdlets?
I am using powercli version 6.0 release 1 build 2548067 I edited the original post to make it appear better.
I am creating a new customization specification using this command: New-OSCustomizationSpec -OSType Linux -Name "lnx_spec_tmp" -Domain "domain.name" -DnsSuffix "dns.suffix" -DnsServer $dns Th... See more...
I am creating a new customization specification using this command: New-OSCustomizationSpec -OSType Linux -Name "lnx_spec_tmp" -Domain "domain.name" -DnsSuffix "dns.suffix" -DnsServer $dns This works great, but doesn't set the timezone. So I change it to this: New-OSCustomizationSpec -OSType Linux -Name "lnx_spec_tmp" -Domain "domain.name" -DnsSuffix "dns.suffix" -DnsServer $dns -TimeZone 130 Now, when I run it, I get a prompt for "Fullname", so I change it to this: New-OSCustomizationSpec -OSType Linux -Name "lnx_spec_tmp" -Domain "domain.name" -DnsSuffix "dns.suffix" -DnsServer $dns -TimeZone 130 -FullName "fullnamehere" Now, when I run it, I get a prompt for "OrgName", so I change it to this: New-OSCustomizationSpec -OSType Linux -Name "lnx_spec_tmp" -Domain "domain.name" -DnsSuffix "dns.suffix" -DnsServer $dns -TimeZone 130 -FullName "fullnamehere" -OrgName "orgnamehere" And now I get the error: New-OSCustomizationSpec : 06/07/2017 18:30:06    New-OSCustomizationSpec        You must specify only parameters that belong to the same parameter set, Windows or Linux.    At line:1 char:1 + New-OSCustomizationSpec -OSType Linux -Name "lnx_spec_tmp" -Domain "domain.name" ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : InvalidArgument: (:) [New-OSCustomizationSpec], InvalidArgument     + FullyQualifiedErrorId : Core_NewCustomizationSpec_DoWork_WrongParameterSet,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewCustomizationSpec What I'm I doing wrong here?
I want to buy a NAS box for a home lab. Either QNAP or Synology or any of the other low end brands. I'll connect it to an ESXi server using iSCSI. What is the one  spec I should be looking for, ... See more...
I want to buy a NAS box for a home lab. Either QNAP or Synology or any of the other low end brands. I'll connect it to an ESXi server using iSCSI. What is the one  spec I should be looking for, so I would have adequate speed when running the VMs on the NAS? So far I was looking for "iSCSI write to target" speeds here​ Is this the spec I should be looking for? I won't have many VMs. Maybe 10 or 15, and they won't be really writing all the time. So what's important when running VMs on a NAS? What's the most important spec I should be looking for?
Thanks for the info. I have a couple of problems. I get message in ISE saying "Get-Stat, A specific parameter was not correct, querySpec.size" and the spread sheet shows identical informati... See more...
Thanks for the info. I have a couple of problems. I get message in ISE saying "Get-Stat, A specific parameter was not correct, querySpec.size" and the spread sheet shows identical information for all the clusters, and no cluster name. (see screen shot)
Hi, I need to get Maximum, Minimum and Average CPU & Memory usage per cluster. For a specific amount of time. for example a week. Currently I am using this: foreach($vmHost in Get-VMHost)... See more...
Hi, I need to get Maximum, Minimum and Average CPU & Memory usage per cluster. For a specific amount of time. for example a week. Currently I am using this: foreach($vmHost in Get-VMHost){   $hoststat = "" | Select HostName, MemMax, MemAvg, MemMin, CPUMax, CPUAvg, CPUMin   $hoststat.HostName = $vmHost.name   $statcpu = Get-Stat -Entity ($vmHost)-start (get-date).AddDays(-7) -Finish (Get-Date)-MaxSamples 100 -stat cpu.usage.average   $statmem = Get-Stat -Entity ($vmHost)-start (get-date).AddDays(-7) -Finish (Get-Date)-MaxSamples 100 -stat mem.usage.average   $cpu = $statcpu | Measure-Object -Property value -Average -Maximum -Minimum   $mem = $statmem | Measure-Object -Property value -Average -Maximum -Minimum   $hoststat.CPUMax = $cpu.Maximum   $hoststat.CPUAvg = $cpu.Average   $hoststat.CPUMin = $cpu.Minimum   $hoststat.MemMax = $mem.Maximum   $hoststat.MemAvg = $mem.Average   $hoststat.MemMin = $mem.Minimum   $allhosts += $hoststat } $allhosts | Select HostName, MemMax, MemAvg, MemMin, CPUMax, CPUAvg, CPUMin | Export-Csv $outputfile -noTypeInformation This though gives me the information I want, per host, not per cluster. How can I get this information per cluster? Thanks
I am currently using the script below to perform hardware checks on all the esxi's. Today I found out that one of the esxi's has a problem with a hard disk, as shown in the attached screen shot.... See more...
I am currently using the script below to perform hardware checks on all the esxi's. Today I found out that one of the esxi's has a problem with a hard disk, as shown in the attached screen shot. Yet, the script did not report any issues with that server. How can I modify this script, to get more reliable hardware status results? foreach($esx in Get-VMHost){     Write-Host "Checking $esx" -ForegroundColor Yellow     (Get-View -Id $esx.ExtensionData.ConfigManager.HealthStatusSystem).Runtime.SystemHealthInfo.NumericSensorInfo |     where{$_.HealthState.Label -notmatch 'Green|Unknown' -and $_.Name -notmatch 'Rollup'} |     Select @{N='Host';E={$esx.Name}},Name,@{N='Health';E={$_.HealthState.Label}} | Format-Table         (Get-View -Id $esx.ExtensionData.ConfigManager.HealthStatusSystem).Runtime.HardwareStatusInfo.MemoryStatusInfo |     where{$_.Status.Label -notmatch 'Green|Unknown'} | Select @{N='Host';E={$esx.Name}},Name,@{N='Health';E={$_.Status.Label}} | Format-Table     (Get-View -Id $esx.ExtensionData.ConfigManager.HealthStatusSystem).Runtime.HardwareStatusInfo.CpuStatusInfo |     where{$_.Status.Label -notmatch 'Green|Unknown'} | Select @{N='Host';E={$esx.Name}},Name,@{N='Health';E={$_.Status.Label}} | Format-Table     (Get-View -Id $esx.ExtensionData.ConfigManager.HealthStatusSystem).Runtime.HardwareStatusInfo.StorageStatusInfo |     where{$_.Status.Label -notmatch 'Green|Unknown'} | Select @{N='Host';E={$esx.Name}},Name,@{N='Health';E={$_.Status.Label}} | Format-Table     }
This KB article describes the issue perfectly. VMware KB: Unable to add a USB device to a virtual machine The solution is not working though.