mark_chuman's Posts

getting snagged on this, but here is what I have: $vms = get-cluster N-MMK-COOP-151-166 | Get-VM foreach ($vm in $vms) { get-stat -Entity $vm -Start 9/27/2016 -Finish 10/18/2016 -CPU | Sel... See more...
getting snagged on this, but here is what I have: $vms = get-cluster N-MMK-COOP-151-166 | Get-VM foreach ($vm in $vms) { get-stat -Entity $vm -Start 9/27/2016 -Finish 10/18/2016 -CPU | Select Value | export-csv -Path B:\scripts\GetHostStats\$vm.csv } The above creates a csv file for each VM.  I'd like to have the data for each VM just be a new column in the same csv file.  Thanks for any thoughts!
The ability to set a newly added harddisk to a powered on VM to multi-writer seems to be new in ESXi 6 via the web client, but I can't find any documentation to say so.  Anyone know where this mi... See more...
The ability to set a newly added harddisk to a powered on VM to multi-writer seems to be new in ESXi 6 via the web client, but I can't find any documentation to say so.  Anyone know where this might reside?  See image
Thanks, I'll take a look.
Thanks Luc.  I'm referring to this: -     Login to web client with administrator@vsphere.local -     Go to administration, access control, global permissions, manage. -     If I add a user her... See more...
Thanks Luc.  I'm referring to this: -     Login to web client with administrator@vsphere.local -     Go to administration, access control, global permissions, manage. -     If I add a user here with readonly role for example.  That permission entry gets added to all vCenter servers. I can loop through all the VCs with new-vipermission, but wanted to see if there was powercli commandlets to mimic adding global permissions through the gui.
Anyone know if this is possible?  Thanks.
Good suggestion.  Are you referring to a location in the VMTN website?  Never used documents here before.
hey everybody.  This thread has been stagnant for some time, but dusting off the old script for our migration from 5.5 to 6.0 and I'll be posting any improvements here.  I'm definitely going to t... See more...
hey everybody.  This thread has been stagnant for some time, but dusting off the old script for our migration from 5.5 to 6.0 and I'll be posting any improvements here.  I'm definitely going to try and get our teams away from using folders and replacing those with tags as it really slows down the migration script.
Many thanks Luc and it's fine if you can't get it.
ignore the other gibberish.  I'm thinking this boils down the problem. PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> $spec = New-Object VMware.Vim.HostConfigManager PowerCLI C:\Scripts\N... See more...
ignore the other gibberish.  I'm thinking this boils down the problem. PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> $spec = New-Object VMware.Vim.HostConfigManager PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> $spec.AdvancedOption += New-Object VMware.Vim.OptionValue Exception setting "AdvancedOption": "Cannot convert the "VMware.Vim.OptionValue" value of type "VMware.Vim.OptionValue" to type "VMware.Vim.ManagedObjectReference"." At line:1 char:1 + $spec.AdvancedOption += New-Object VMware.Vim.OptionValue + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException     + FullyQualifiedErrorId : ExceptionWhenSetting
Uggh, this looks nasty. PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> $spec = New-Object VMware.Vim.HostConfigManage PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> $spec CpuSchedule... See more...
Uggh, this looks nasty. PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> $spec = New-Object VMware.Vim.HostConfigManage PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> $spec CpuScheduler              : DatastoreSystem           : MemoryManager             : StorageSystem             : NetworkSystem             : VmotionSystem             : VirtualNicManager         : ServiceSystem             : FirewallSystem            : AdvancedOption            : DiagnosticSystem          : AutoStartManager          : SnmpSystem                : DateTimeSystem            : PatchManager              : ImageConfigManager        : BootDeviceSystem          : FirmwareSystem            : HealthStatusSystem        : PciPassthruSystem         : LicenseManager            : KernelModuleSystem        : AuthenticationManager     : PowerSystem               : CacheConfigurationManager : EsxAgentHostManager       : IscsiManager              : VFlashManager             : VsanSystem                : GraphicsManager           : VsanInternalSystem        : LinkedView                : DynamicType               : DynamicProperty           : Seems to mimic version 4.0??  I must be missing something. https://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.host.ConfigManager.html
here's my powerli versions output PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> Get-VIToolkitVersion PowerCLI Version ----------------    VMware vSphere PowerCLI 5.5 Release 2 buil... See more...
here's my powerli versions output PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> Get-VIToolkitVersion PowerCLI Version ----------------    VMware vSphere PowerCLI 5.5 Release 2 build 1671586 --------------- Snapin Versions ---------------    VMWare AutoDeploy PowerCLI Component 5.5 build 1598391    VMWare ImageBuilder PowerCLI Component 5.5 build 1598391    VMware License PowerCLI Component 5.5 build 1265954    VMware VDS PowerCLI Component 5.5 build 1671576    VMware vSphere PowerCLI Component 5.5 build 1671576 ESX and VC wise, we are on 5.5 update 3 Many thanks Luc
The post from you I was referencing Specify the boot devices for a virtual machine
Here's what I've got in the advsettings.csv setting,value Syslog.loggers.sdrsInjector.rotate,20 and this matches with what is returned here for the host I'm targeting: get-vmhost esxhos... See more...
Here's what I've got in the advsettings.csv setting,value Syslog.loggers.sdrsInjector.rotate,20 and this matches with what is returned here for the host I'm targeting: get-vmhost esxhostname | %{ $hostn=$_.Name; Get-VMHostAdvancedConfiguration -VMHost $_ | % { $_.getEnumerator()| ? {$_.Key -like "Syslog.loggers.sdr*"}|select Name,Value }  } Name ---- Syslog.loggers.sdrsInjector.rotate Syslog.loggers.sdrsInjector.size I tried to echo out the values, but it comes back as VMware.Vim.OptionValue, so not helpful there. PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> .\faster.ps1 Exception calling "UpdateOptions" with "1" argument(s): "The request refers to an unexpected or unknown type." At C:\Scripts\Nutanix\ESX Advanced Settings\faster.ps1:15 char:5 +     $advSettingsMgr.UpdateOptions($values) +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException     + FullyQualifiedErrorId : VimException VMware.Vim.OptionValue I found this post from you a while back, but it appears that host level changes do not have the same methods (ReconfigVM_Task) available.  I was sort of working with something similar, but for hosts $spec = New-Object VMware.Vim.HostConfigManager $spec.extraConfig += New-Object VMware.Vim.OptionValue  $spec.extraConfig[0].key = "Syslog.loggers.sdrsInjector.rotate"  $spec.extraConfig[0].value = "20" (get-view (Get-vmhost -Name vtsr6201.fmr.com).ID).ReconfigVM_Task($spec) Hitting a snag with the .ReconfigVM_Task part as I'm unable to find that for hosts. Thanks!
Thanks Luc.  Trying to dissect now, but hitting an error.  I've reduced the advsettings.csv contents to the lines below. PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> .\faster.ps1 Ex... See more...
Thanks Luc.  Trying to dissect now, but hitting an error.  I've reduced the advsettings.csv contents to the lines below. PowerCLI C:\Scripts\Nutanix\ESX Advanced Settings> .\faster.ps1 Exception calling "UpdateOptions" with "1" argument(s): "The request refers to an unexpected or unknown type." At C:\Scripts\Nutanix\ESX Advanced Settings\faster.ps1:15 char:5 +     $advSettingsMgr.UpdateOptions($values) +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException     + FullyQualifiedErrorId : VimException ------ csv contents setting,value Syslog.loggers.sdrsInjector.rotate,20
this takes quite a long time (5 minutes for about 70 items) per host.  any ideas on how to speed this up (hit the host directly at console, run async etc.) $vmhosts = Import-Csv ".\vmhosts.c... See more...
this takes quite a long time (5 minutes for about 70 items) per host.  any ideas on how to speed this up (hit the host directly at console, run async etc.) $vmhosts = Import-Csv ".\vmhosts.csv" $advsettings = Import-Csv ".\advsettings.csv" Write-Host " " foreach ($vmhost in $vmhosts) {   # Get Start Time   $startDTM = (Get-Date)   foreach ($advsetting in $advsettings) {   Get-AdvancedSetting -Entity $vmhost.name -Name $advsetting.setting | Set-AdvancedSetting -Value $advsetting.value -Confirm:$false   }   # Get End Time   $endDTM = (Get-Date)   # Echo Time elapsed   "Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" } Thanks!
I adjusted the code to this and we're good.  I'll have to look through the rest of the overall script for similar items. foreach ($vmhost in get-cluster -name $Cluster | get-vmhost | select Na... See more...
I adjusted the code to this and we're good.  I'll have to look through the rest of the overall script for similar items. foreach ($vmhost in get-cluster -name $Cluster | get-vmhost | select Name) ` {Connect-VIServer -Server $vmhost.name -User root -Password $esxpass disconnect-viserver $vmhost.name -confirm:$false} *I know the format is horrible
yeah, the code is hardened.  i use it in a VC migration script that we've used hundreds of times.  this portion is going out and checking root password before moving on with the actual migration.... See more...
yeah, the code is hardened.  i use it in a VC migration script that we've used hundreds of times.  this portion is going out and checking root password before moving on with the actual migration.  we just now are using it on really large clusters.  up until now it's only been used on 16 node clusters, max.
Just hit this one and I welcome any other insight. Here is the code ---- $Cluster = "clustername" $esxpass = "password" $esxcheck = foreach ($vmhost in get-cluster -name $Cluster | get-vmho... See more...
Just hit this one and I welcome any other insight. Here is the code ---- $Cluster = "clustername" $esxpass = "password" $esxcheck = foreach ($vmhost in get-cluster -name $Cluster | get-vmhost | select Name) ` {Connect-VIServer -Server $vmhost.name -User root -Password $esxpass} foreach ($vmhost in get-cluster -name $Cluster | get-vmhost | select Name) ` {disconnect-viserver $vmhost.name -confirm:$false} Works fine on a 16 node cluster, but fails with the error on a 31 node cluster  :smileycry:
Very cool.  Also, pay attention to the readme in the main folder as it lists out some gotchas I hit.
Let me take a deeper look at your transcript, but a couple options you have are to just comment out certain sections that you are having trouble with or adjust the error reporting for that sectio... See more...
Let me take a deeper look at your transcript, but a couple options you have are to just comment out certain sections that you are having trouble with or adjust the error reporting for that section.  Example. Commenting out:   Adjusting error reporting for just a section: On the folder errors make sure you are not getting hit by duplicates.  Folders were the bane of my existence with the script as we use them and notes/annotations extensively.  Caused the most problems and greatly slowed down the migration of the cluster. Duplicate folder names that exist under the same vCenter - ie, the same folder name existing say in different datacenters under the same VC.