de2rfg's Posts

I've now a solution that returns data for VM's with two SCSI Controller. Funny thing is that for at least one VM I still get wrong results. This VM has 4 controllers, but only 3 have attached dis... See more...
I've now a solution that returns data for VM's with two SCSI Controller. Funny thing is that for at least one VM I still get wrong results. This VM has 4 controllers, but only 3 have attached disks. This seems to confuse the scrip.Not sure which other VM's might have false results. VM: HD1     SCSI  0 0 HD2     SCSI 1 0 HD3     SCSI 3 0  (note: not 2 0) $ServerDiskToVolume: SCSI Bus is wrong for D drive. It should be 0 3. DeviceID                                            VolumeName                                                                                  SCSITarget                                            SCSIBus --------                                            ----------                                                                                  ----------                                            -------                                                   xxxx_D                                                                                           0                                                  2 E:                                                  xxxx_E                                                                                           0                                                  1 C:                                                  xxxx_C                                                                                           0                                                  0 Thus in the script result D:is missing as Device ID. VM       HostName           DiskFile                                               DiskName         DiskSize SCSIController SCSITarget DeviceID --       --------           --------                                               --------         -------- -------------- ---------- -------- xxxx xxxx [xxxx_LUN048] xxxx/xxxx.vmdk   Hard disk 1   53687091200              0          0 C:      xxxx xxxx [xxxx_LUN048] xxxx/xxxx_1.vmdk Hard disk 2 1503238553600              1          0 E:      xxxx xxxx [xxxx_LUN048] xxxx/xxxx_3.vmdk Hard disk 3 1099511627776              3          0         #Example snippet to tie a Windows Volume to a VMware clear $cred = Get-Credential -Credential "xxxx" #Define computername $computers = "xxxx" foreach ($computer in $computers) { Write $computer #Change this as needed. Our standard display name is the hostname followed by a space... $VMView = Get-VM -Name $computer | Get-View $session = New-CimSession –ComputerName $computer -Credential $cred $ServerDiskToVolume = @( foreach($disk in (Get-CimInstance -CimSession $session -ClassName Win32_DiskDrive)){     #Write-Output "Disk: " $disk   foreach($partition in (Get-CimAssociatedInstance -CimSession $session -InputObject $disk -ResultClassName Win32_DiskPartition)){         #Write-Output "Partition: " $partition   Get-CimAssociatedInstance -CimSession $session -InputObject $partition -ResultClassName Win32_LogicalDisk | select DeviceID, VolumeName,             #Write-Output "$($disk.SCSIPort-2):$($disk.SCSITargetId) $($_.DeviceID) $($_.VolumeName)"   @{ label = "SCSITarget"; expression = {$disk.SCSITargetId} },   @{ label = "SCSIBus"; expression = {$disk.SCSIPort-2} }         }     } Remove-CimSession -Name  * ) <# Commented out for later use. $ServerDiskToVolume = @(   Get-WmiObject -Credential $cred -Class Win32_DiskDrive -ComputerName $computer | foreach {   $Dsk = $_   $query = "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='$($_.DeviceID)'} WHERE ResultClass=Win32_DiskPartition"   Get-WmiObject -Credential $cred -Query $query -ComputerName $computer | foreach {   $query = "ASSOCIATORS OF {Win32_DiskPartition.DeviceID='$($_.DeviceID)'} WHERE ResultClass=Win32_LogicalDisk"   Get-WmiObject -Credential $cred -Query $query -ComputerName $computer | Select DeviceID,VolumeName,   @{ label = "SCSITarget"; expression = {$dsk.SCSITargetId} },   @{ label = "SCSIBus"; expression = {$dsk.SCSIPort-2} }   }   } ) #> Write-Output $ServerDiskToVolume # Now loop thru all the SCSI controllers on the VM and find those that match the Controller and Target $VMDisks = ForEach ($VirtualSCSIController in ($VMView.Config.Hardware.Device | Where {$_.DeviceInfo.Label -match "SCSI Controller"})) {   ForEach ($VirtualDiskDevice in ($VMView.Config.Hardware.Device | Where {$_.ControllerKey -eq $VirtualSCSIController.Key})) {   #Match up this VM to a logical disk   $MatchingDisk = @( $ServerDiskToVolume | Where {$_.SCSITarget -eq $VirtualDiskDevice.UnitNumber -and $_.SCSIBus -eq $VirtualSCSIController.BusNumber} )   #Build a custom object to hold this. We use PS3 language...   [pscustomobject]@{   VM = $VMView.Name   HostName = $VMView.Guest.HostName   DiskFile = $VirtualDiskDevice.Backing.FileName   DiskName = $VirtualDiskDevice.DeviceInfo.Label   DiskSize = $VirtualDiskDevice.CapacityInKB * 1KB   SCSIController = $VirtualSCSIController.BusNumber   SCSITarget = $VirtualDiskDevice.UnitNumber   DeviceID = $MatchingDisk.DeviceID   }   } } $VMDisks | ft -AutoSize #| out-file -append c:\Users\rfg\vm_disk.txt }
I'm also having problems to find or write a script that reports the VMDK, SCSI ID, Windows drive letters. The best I could find is the following; VMware: matching guest drives to .vmdk files? ... See more...
I'm also having problems to find or write a script that reports the VMDK, SCSI ID, Windows drive letters. The best I could find is the following; VMware: matching guest drives to .vmdk files? - Ars Technica OpenForum It works nicely as long as the VM has only a one SCSI controller. Any idea to modify the script to work with multipe SCSI controller? VM       HostName              DiskFile                                      DiskName       DiskSize SCSIController SCSITarget DeviceID --       --------              --------                                      --------       -------- -------------- ---------- -------- xxxx2019 xxxx2019      [xx_Tiering_LUN038] xxxx2019/xxxx2019.vmdk    Hard disk 1 42949672960              0          0 {D:, C:} xxxx2019 xxxx2019      [xx_Tiering_LUN038] xxxx2019/xxxx2019_1.vmdk Hard disk 2 21474836480              1          0        xxxx2019 xxxx2019      [xx_Tiering_LUN038] xxxx2019/xxxx2019_2.vmdk Hard disk 3 75161927680              1          1       
PowerCLI C:\> Get-ContentLibraryItem -Name RHEL6 | Select * WARNING: PowerCLI scripts should not use the 'Client' property. The property will be removed in a future release. SizeGB   ... See more...
PowerCLI C:\> Get-ContentLibraryItem -Name RHEL6 | Select * WARNING: PowerCLI scripts should not use the 'Client' property. The property will be removed in a future release. SizeGB         : 0.0000054258853197097778320312 Description    : CreationTime   : 11/12/2015 13:14:36 LastWriteTime  : 11/12/2015 13:15:36 ItemType       : ovf ContentLibrary : Global Id             : 4fccaa4e-4e56-4800-98af-3e79ab6b55df Name           : RHEL6 Uid            : /VIServer=festo\de2rfg@sdes0234:443/ContentLibraryItem=4fccaa4e-4e56-4800-98af-3e79ab6b55df/ Client         : VMware.VimAutomation.ViCore.Impl.V1.VimClient Content Library is broken in so many ways, we are considering to abandon it.
Hi, I'm writing a script that should deploy VM's from our content libraries. But so far my tests fail. I always get an Could not convert field 'error' of structure 'com.vmware.vcenter.ovf.libr... See more...
Hi, I'm writing a script that should deploy VM's from our content libraries. But so far my tests fail. I always get an Could not convert field 'error' of structure 'com.vmware.vcenter.ovf.library_item.deployment_result'  error. New release: PowerCLI 6.3 R1–Download it today! - VMware PowerCLI Blog - VMware Blogs vSphere 6.0 Documentation Center Example from above: Get-ContentLibraryItem -Name TTYLinux | New-VM -Datastore datastore1 -VMHost 10.160.74.38 Adjusted to my environment: PS C:\Users\de2rfg> Get-ContentLibraryItem -Name RHEL6 | New-VM -Datastore C23_Tiering_LUN034 -VMHost sdev2310.xxxx.xx New-VM : 11.08.2016 08:39:57    New-VM        Could not convert field 'error' of structure 'com.vmware.vcenter.ovf.library_item.deployment_result'   At line:1 char:38 + Get-ContentLibraryItem -Name RHEL6 | New-VM -Datastore C23_Tiering_LUN034 -VMHos ... +                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [New-VM], ViError     + FullyQualifiedErrorId : VICore_VMServiceImpl_DeployFromLibraryItem_Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM I though this would be because of the missing name of the new VM, but it's not working either PS C:\Users\de2rfg> Get-ContentLibraryItem -Name RHEL6 | New-VM -Name TestCL -Datastore C23_Tiering_LUN034 -VMHost sdev2310.xxxx.xx New-VM : 11.08.2016 08:42:20    New-VM        Could not convert field 'error' of structure 'com.vmware.vcenter.ovf.library_item.deployment_result'   At line:1 char:38 + Get-ContentLibraryItem -Name RHEL6 | New-VM -Name TestCL -Datastore C23_Tiering_ ... +                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [New-VM], ViError     + FullyQualifiedErrorId : VICore_VMServiceImpl_DeployFromLibraryItem_Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM get-datastore C23_Tiering_LUN034 Name                               FreeSpaceGB      CapacityGB ----                               -----------      ---------- C23_Tiering_LUN034                   1.448,211       4.095,750 Get-ContentLibraryItem -Name RHEL6 Name                           ContentLibrary                 ItemType                       SizeGB        ----                           --------------                 --------                       ------        RHEL6                          Global                         ovf                            0,000   PowerCLI Version ----------------    VMware vSphere PowerCLI 6.3 Release 1 build 3737840 --------------- Component Versions ---------------    VMware Cloud Infrastructure Suite PowerCLI Component 6.3 build 3709081    VMWare AutoDeploy PowerCLI Component 6.0 build 3736841    VMWare ImageBuilder PowerCLI Component 6.0 build 3736841    VMware vSphere PowerCLI Component 6.3 build 3709081    VMware vSphere Update Manager PowerCLI 6.0 build 2503190    VMware VDS PowerCLI Component 6.3 build 3709081
The problem did not happen again today. I'll let you know if a restart helps next time the problem occurs.
After I've run the script a couple of times I get the error "Operation is not valid due to the current state of the object" for several commands. I'm not sure if this is related to the nested ESX... See more...
After I've run the script a couple of times I get the error "Operation is not valid due to the current state of the object" for several commands. I'm not sure if this is related to the nested ESXi host I'm testing this with, After a remediate I go back to a snap without the current ESXi patches.
I've added a sleep 30 before which didn't change the behaviour. But today after restarting ISE and running the script again, I get no error. Everything is working as expected. Seems to be one of ... See more...
I've added a sleep 30 before which didn't change the behaviour. But today after restarting ISE and running the script again, I get no error. Everything is working as expected. Seems to be one of the powercli problems that I saw in other threads before. This is a bit frustrating.
With ISE Test-Compliance command is working again. Now I'm back to my initial problem "Operation is not valid due to the current state of the object". Host was put in maintenance mode and the sca... See more...
With ISE Test-Compliance command is working again. Now I'm back to my initial problem "Operation is not valid due to the current state of the object". Host was put in maintenance mode and the scan and remediate commands are executed but due to the error the scrip does not wait until the host was patched and rebooted,  the script immediately continues with the next code line and the host leaves maintenance mode and VM's a also restarted. Scan-Inventory : 11.07.2016 13:15:13 Test-Compliance   Operation is not valid due to the current state of the object.   At D:\VMware_Skripte\patch_host.ps1:71 char:1 + Scan-Inventory -Entity $esxi -UpdateType HostPatch + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo     : NotSpecified: (:) [Test-Compliance], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VumAutomation.Commands.ScanInventory Remediate-Inventory : 11.07.2016 13:15:30 Update-Entity   Operation is not valid due to the current state of the object.   At D:\VMware_Skripte\patch_host.ps1:83 char:1 + Remediate-Inventory -Baseline $baselines -Entity $esxi -Confirm:$false + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo     : NotSpecified: (:) [Update-Entity], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VumAutomation.Commands.RemediateInventory # Enter Maintenance Mode Write-Host "** Set Maintenance Mode **" Get-VMHost -Name $esxi | Set-VMHost -State Maintenance -Confirm:$false | Out-Null # Scan Host Write-Host "** Scan Host **" Scan-Inventory -Entity $esxi -UpdateType HostPatch # Check for missing patches Write-Host "** Missing patches before Update **" (Get-Compliance -Entity $esxi  -Detailed).NotCompliantPatches | Select-Object Name,IDByVendor,Description,@{n='Product';e={$_.product | Select-Object -expandproperty Version}},ReleaseDate # Get Baselines Write-Host "** Get Baselines **" $baselines = Get-Baseline -Entity $esxi -Inherit # Remediate Host Write-Host "Remediate Host **" Remediate-Inventory -Baseline $baselines -Entity $esxi -Confirm:$false # Leave Maintenence Mode Write-Host "** Leave Maintenance Mode **" Get-VMHost -Name $esxi | Set-VMHost -State Connected
Running in PowerShell command window is working fine, it seems it only happens in PowerGUI. There seems to be a difference in the get-command output depending on where I run it and Test-Complianc... See more...
Running in PowerShell command window is working fine, it seems it only happens in PowerGUI. There seems to be a difference in the get-command output depending on where I run it and Test-Compliance is missing. PowerShell: PS C:\Users\de2rfg> Get-Command -Module VMware.VumAutomation CommandType     Name                                               ModuleName -----------     ----                                               ---------- Alias           Attach-Baseline                                    VMware.VumAutomation Alias           Detach-Baseline                                    VMware.VumAutomation Alias           Download-Patch                                     VMware.VumAutomation Alias           Remediate-Inventory                                VMware.VumAutomation Alias           Scan-Inventory                                     VMware.VumAutomation Alias           Stage-Patch                                        VMware.VumAutomation Cmdlet          Add-EntityBaseline                                 VMware.VumAutomation Cmdlet          Copy-Patch                                         VMware.VumAutomation Cmdlet          Get-Baseline                                       VMware.VumAutomation Cmdlet          Get-Compliance                                     VMware.VumAutomation Cmdlet          Get-Patch                                          VMware.VumAutomation Cmdlet          Get-PatchBaseline                                  VMware.VumAutomation Cmdlet          New-PatchBaseline                                  VMware.VumAutomation Cmdlet          Remove-Baseline                                    VMware.VumAutomation Cmdlet          Remove-EntityBaseline                              VMware.VumAutomation Cmdlet          Set-PatchBaseline                                  VMware.VumAutomation Cmdlet          Sync-Patch                                         VMware.VumAutomation Cmdlet          Test-Compliance                                    VMware.VumAutomation Cmdlet          Update-Entity                                      VMware.VumAutomation PowerGUI (just started before I entered the command): PS C:\Users\de2rfg\Documents> Get-Command -Module VMware.VumAutomation -Verbose CommandType     Name                                               ModuleName                                                                                      -----------     ----                                               ----------                                                                                      Alias           Attach-Baseline                                    VMware.VumAutomation                                                                            Alias           Detach-Baseline                                    VMware.VumAutomation                                                                            Alias           Download-Patch                                     VMware.VumAutomation                                                                            Alias           Remediate-Inventory                                VMware.VumAutomation                                                                            Alias           Scan-Inventory                                     VMware.VumAutomation                                                                            Alias           Stage-Patch                                        VMware.VumAutomation                                                                            Cmdlet          Attach-Baseline                                    VMware.VumAutomation                                                                            Cmdlet          Detach-Baseline                                    VMware.VumAutomation                                                                            Cmdlet          Download-Patch                                     VMware.VumAutomation                                                                            Cmdlet          Get-Baseline                                       VMware.VumAutomation                                                                            Cmdlet          Get-Compliance                                     VMware.VumAutomation                                                                            Cmdlet          Get-Patch                                          VMware.VumAutomation                                                                            Cmdlet          Get-PatchBaseline                                  VMware.VumAutomation                                                                            Cmdlet          New-PatchBaseline                                  VMware.VumAutomation                                                                            Cmdlet          Remediate-Inventory                                VMware.VumAutomation                                                                            Cmdlet          Remove-Baseline                                    VMware.VumAutomation                                                                            Cmdlet          Scan-Inventory                                     VMware.VumAutomation                                                                            Cmdlet          Set-PatchBaseline                                  VMware.VumAutomation                                                                            Cmdlet          Stage-Patch                                        VMware.VumAutomation                                                                           
I've updated to 6.3 after the problems began, before it was some other 6.x version. Also latest VUM powercli package.
I've already rebooted the host, no difference.
I've already rebooted the host, no difference.
Hi, not sure what is going wrong at the moment, but I've installed VUM powercli package and I did some testing yesterday. Today Scan-Inentory and other VUM powercli commands fail with error "T... See more...
Hi, not sure what is going wrong at the moment, but I've installed VUM powercli package and I did some testing yesterday. Today Scan-Inentory and other VUM powercli commands fail with error "Test-Compliance' is not recognized as the name of a cmdlet..." But as far as I can see the VUM powercli snapin/module is installed and loaded. Scan-Inventory -Entity xxxx Scan-Inventory : The term 'Test-Compliance' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Scan-Inventory -Entity xxxxx + ~~~~~~~~~~~~~~     + CategoryInfo          : ObjectNotFound: (Test-Compliance:String) [], CommandNotFoundException     + FullyQualifiedErrorId : CommandNotFoundException Add-PSSnapin VMware.VumAutomation Add-PSSnapin : Cannot add Windows PowerShell snap-in VMware.VumAutomation because it is already added. Verify the name of the snap-in, and then try again. At line:1 char:1 + Add-PSSnapin VMware.VumAutomation + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : InvalidArgument: (VMware.VumAutomation:String) [Add-PSSnapin], PSArgumentException     + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand > Import-Module VMware.VumAutomation -Verbose                                                                                                                                                               VERBOSE: Loading module from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.psd1'. VERBOSE: Loading 'Assembly' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\IntegritySoapService40.dll'. VERBOSE: Loading 'Assembly' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\IntegritySoapService40.XmlSerializers.dll'. VERBOSE: Loading 'Assembly' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.Client40.dll'. VERBOSE: Loading 'Assembly' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\VMware.VumAutomation.dll'. VERBOSE: Loading 'Assembly' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\VMware.VumAutomation.Types.dll'. VERBOSE: Loading 'FormatsToProcess' from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.Format.ps1xml'. VERBOSE: Loading module from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\Initialize-VMware_VumAutomation.ps1'. VERBOSE: Dot-sourcing the script file 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\Initialize-VMware_VumAutomation.ps1'. VERBOSE: Loading module from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.ps1'. VERBOSE: Dot-sourcing the script file 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.ps1'. VERBOSE: Loading module from path 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VumAutomation\VMware.VumAutomation.dll'. VERBOSE: Exporting cmdlet 'Attach-Baseline'. VERBOSE: Exporting cmdlet 'Get-Baseline'. VERBOSE: Exporting cmdlet 'Detach-Baseline'. VERBOSE: Exporting cmdlet 'Download-Patch'. VERBOSE: Exporting cmdlet 'Get-Compliance'. VERBOSE: Exporting cmdlet 'Get-Patch'. VERBOSE: Exporting cmdlet 'Get-PatchBaseline'. VERBOSE: Exporting cmdlet 'New-PatchBaseline'. VERBOSE: Exporting cmdlet 'Remove-Baseline'. VERBOSE: Exporting cmdlet 'Set-PatchBaseline'. VERBOSE: Exporting cmdlet 'Remediate-Inventory'. VERBOSE: Exporting cmdlet 'Scan-Inventory'. VERBOSE: Exporting cmdlet 'Stage-Patch'. WARNING: The names of some imported commands from the module 'VMware.VumAutomation' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb. VERBOSE: The 'Attach-Baseline' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. The suggested alternative verbs are "Add, Debug". VERBOSE: Importing cmdlet 'Attach-Baseline'. VERBOSE: The 'Detach-Baseline' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. The suggested alternative verbs are "Dismount, Remove". VERBOSE: Importing cmdlet 'Detach-Baseline'. VERBOSE: The 'Download-Patch' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. For a list of approved verbs, type Get-Verb. VERBOSE: Importing cmdlet 'Download-Patch'. VERBOSE: Importing cmdlet 'Get-Baseline'. VERBOSE: Importing cmdlet 'Get-Compliance'. VERBOSE: Importing cmdlet 'Get-Patch'. VERBOSE: Importing cmdlet 'Get-PatchBaseline'. VERBOSE: Importing cmdlet 'New-PatchBaseline'. VERBOSE: The 'Remediate-Inventory' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. For a list of approved verbs, type Get-Verb. VERBOSE: Importing cmdlet 'Remediate-Inventory'. VERBOSE: Importing cmdlet 'Remove-Baseline'. VERBOSE: The 'Scan-Inventory' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. For a list of approved verbs, type Get-Verb. VERBOSE: Importing cmdlet 'Scan-Inventory'. VERBOSE: Importing cmdlet 'Set-PatchBaseline'. VERBOSE: The 'Stage-Patch' command in the VMware.VumAutomation' module was imported, but because its name does not include an approved verb, it might be difficult to find. For a list of approved verbs, type Get-Verb. VERBOSE: Importing cmdlet 'Stage-Patch'.
Hi, I'm working on a script to patch our single ESXi hosts. But the Scan-Inventory command gives me an error although it is executed  successfully and the host was put into maintenance mode. ... See more...
Hi, I'm working on a script to patch our single ESXi hosts. But the Scan-Inventory command gives me an error although it is executed  successfully and the host was put into maintenance mode. ... Get-VMHost -Name $esxi | Set-VMHost -State Maintenance -Confirm:$false | Out-Null Scan-Inventory -Verbose -Entity $esxi -UpdateType HostPatch ... VERBOSE: 08.07.2016 09:36:42    Test-Compliance    Started execution VERBOSE: Performing operation 'Scan Inventory' on target: 'xxxxxx' VERBOSE: 08.07.2016 09:36:47    Test-Compliance    Finished execution Scan-Inventory : 08.07.2016 09:36:47    Test-Compliance        Operation is not valid due to the current state of the object.   At D:\VMware_Skripte\patch_host.ps1:51 char:1 + Scan-Inventory -Verbose -Entity $esxi -UpdateType HostPatch + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [Test-Compliance], VimException     + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VumAutomation.Commands.ScanInventory vCenter Tasks/Events Scan entity xxxxx Completed xxxxx xxxxx 08/07/2016 09:28:55 08/07/2016 09:28:55 08/07/2016 09:29:10 Enter maintenance mode xxxxx Completed xxxxx xxxxx 08/07/2016 09:28:38 08/07/2016 09:28:38 08/07/2016 09:28:38 I don't see what the problem could be, any ideas? Edit: Remediate also fails Remediate-Inventory : 08.07.2016 10:16:39 Update-Entity    Operation is not valid due to the current state of the object.    At D:\VMware_Skripte\patch_host.ps1:57 char:1 + Remediate-Inventory -Baseline $baselines -Entity $esxi -Confirm:$false + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo      : NotSpecified: (:) [Update-Entity], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VumAutomation.Commands.RemediateInventory
As far as I can see it simply keeps the value if I remove the line. So if it's set to automated and I only set the affinity rule for the VMDK's it will keep this setting. I'd like to do both in m... See more...
As far as I can see it simply keeps the value if I remove the line. So if it's set to automated and I only set the affinity rule for the VMDK's it will keep this setting. I'd like to do both in my script, set the anti affinity rule for disks (remove keep together rule) and set the policy to default.
Maybe I was not completely clear. I still want to override the "keep together" rule, but want to keep the Default automation level. I think I can simply remove the "$vm.Info.Behavior = [VM... See more...
Maybe I was not completely clear. I still want to override the "keep together" rule, but want to keep the Default automation level. I think I can simply remove the "$vm.Info.Behavior = [VMware.Vim.StorageDrsPodConfigInfoBehavior]::automated" line but it would be nice if I could change the "automated" to "default".
Did version 118 work for you? I installed it a while ago but still see "vmkernel: cpu16:32841)WARNING: LinScsi: SCSILinuxAbortCommands:1891: Failed, Driver hpsa, for vmhba1" warnings.
Hi, is there a way to set the behaviour to the cluster default value? $vm.Info.Behavior =[VMware.Vim.StorageDrsPodConfigInfoBehavior]::automated https://www.vmware.com/support/develope... See more...
Hi, is there a way to set the behaviour to the cluster default value? $vm.Info.Behavior =[VMware.Vim.StorageDrsPodConfigInfoBehavior]::automated https://www.vmware.com/support/developer/converter-sdk/conv60_apireference/vim.storageDrs.PodConfigInfo.Behavior.html‌ I see only manual and automated as values?
We have similar problems but only 3 vCenter spread over the world. Support once told me that the Web Client problems may come from the latencies between the sites and that these latencies are not... See more...
We have similar problems but only 3 vCenter spread over the world. Support once told me that the Web Client problems may come from the latencies between the sites and that these latencies are not supported (100-200ms). I opend a case to get information what max. latencies are supported but never got any useful results. Support did some testing, complained about MTU and other parameters that must be set because of VPN etc. It seems also that there is no KB article on how to break a enhanced linked mode setup and separate the vCenter's/PSC's. All in all disappointing.
Hi, I just want other users know that the content library feature is more than just a little bit buggy. We use this feature for a while now and noticed that VM's were deployed on scratch datas... See more...
Hi, I just want other users know that the content library feature is more than just a little bit buggy. We use this feature for a while now and noticed that VM's were deployed on scratch datastores, temporary datastores and so on. It turns out that even if I choose a certain storage policy and datastore (cluster) the content library deployment process does silently create the VM's on a completely different datastores. Without any information, error, warning. We noticed this after a couple of weeks because scratch datastores were filling up, VM's that were created on a transfer datastore that was mapped only to one host in a cluster could not vMotioned (thank god no HA was triggered in this cluster while the VM was running on this host/datastore). I already tried a workaround and created a role without permissions to create VM's on the affected datastores. This permission is completely ignored by the content library deployment process. Even if a user can't access the affected datastore in vCenter. VMware confirmed the bug a while ago, but there is no KB arcticel and no hotfix. This sucks and is from my point of view a critical bug.