internetrush's Posts

Want to partially automate uploading support dumps for specific vmware hosts for tickets, not sure if there is a way to do this but here is what i have so far: function get-VMhostSupportDum... See more...
Want to partially automate uploading support dumps for specific vmware hosts for tickets, not sure if there is a way to do this but here is what i have so far: function get-VMhostSupportDump {     param(     [string]$vmhostname,     [System.Automation.PScredential]$credential,     [string]$FullyQualifiedFilePath='c:\temp\test2.tgz'         )     $uri = "https://$vmhostname/cgi-bin/vm-support.cgi"     $supportRequest = Invoke-WebRequest -Uri $uri -credential $credential     if($supportRequest.StatusCode -eq 200){         write-host "Success, writing file to $FullyQualifiedFilePath"     }else{         throw "Cannot get HTTP data from $uri"     }     try{         [io.file]::WriteAllBytes($FullyQualifiedFilePath,($supportRequest.content))         write-host "Sucessfully wrote TGZ to $FullyQualifiedFilePath"     }catch{         throw "Data not written to $FullyQualifiedFilePath : $_"     } } The above function writes out a VMhost support dump in the TGZ format, the dump then needs to be uploaded to an FTPsite, FTPsite.vmware.com specifically: function upload-FTPsite{     param(         $inboundCredential=(Get-Credential),         $ftpSite='ftp://ftpsite.vmware.com',         $FullyQualifiedFilePath             )     # create the FtpWebRequest and configure it     $ftp = [System.Net.FtpWebRequest]::Create($ftpSite)     $ftp = [System.Net.FtpWebRequest]$ftp     $ftp.Method = [System.Net.WebRequestMethods+Ftp]::UploadFile     $ftp.Credentials = new-object System.Net.NetworkCredential(($inboundCred.GetNetworkCredential().username),($inboundCred.GetNetworkCredential().password))     $ftp.UseBinary = $true     $ftp.UsePassive = $true     # read in the file to upload as a byte array     $content = [System.IO.File]::ReadAllBytes($FullyQualifiedFilePath)     $ftp.ContentLength = $content.Length     # get the request stream, and write the bytes into it     $rs = $ftp.GetRequestStream()     $rs.Write($content, 0, $content.Length)     # be sure to clean up after ourselves     $rs.Close()     $rs.Dispose() } The above function more or less works, but i cannot get the URI correct even for an existing directory. Anyone got anything on this that they can share / know? Would like to basically take the one function and foreach into another so i can auto-upload to the site. Anyway to do this?
was wondering why a script we used to audit our sesisons wasnt working and found that   VMware vSphere PowerCLI 6.3 Release 1 build 3737840 no longer has GET-VISESSION as a cmdlet, did anyone els... See more...
was wondering why a script we used to audit our sesisons wasnt working and found that   VMware vSphere PowerCLI 6.3 Release 1 build 3737840 no longer has GET-VISESSION as a cmdlet, did anyone else see this deprecated? I simply cannot find it and have all modules and pssnappins loaded related to vmware    
This is indeed the case from what ive found as well.
I'm seeing similar things here: 2016-08-16T14:15:24.328Z warning vpxd[7FAA976ED700] [Originator@6876 sub=VpxProfiler opID=HB-host-1696@11319-6da279df-[DRS]NotifyDeviceModelChanges-313dc3b7]... See more...
I'm seeing similar things here: 2016-08-16T14:15:24.328Z warning vpxd[7FAA976ED700] [Originator@6876 sub=VpxProfiler opID=HB-host-1696@11319-6da279df-[DRS]NotifyDeviceModelChanges-313dc3b7] [DRS]NotifyDeviceModelChanges [TotalTime] took 13205 ms 2016-08-16T14:15:24.330Z warning vpxd[7FAA626CD700] [Originator@6876 sub=VpxProfiler opID=HB-host-1696@11319-6da279df-[DRS]NotifyDeviceModelChanges-a23e30] [DRS]NotifyDeviceModelChanges [TotalTime] took 13077 ms 2016-08-16T14:15:24.383Z warning vpxd[7FAAD6949700] [Originator@6876 sub=VpxProfiler opID=HB-host-1696@11319-6da279df-[DRS]NotifyDeviceModelChanges-6c566149] [DRS]NotifyDeviceModelChanges [TotalTime] took 13134 ms 2016-08-16T14:15:24.385Z warning vpxd[7FAAA97AF700] [Originator@6876 sub=VpxProfiler opID=HB-host-1696@11319-6da279df-[DRS]NotifyDeviceModelChanges-5708c280] [DRS]NotifyDeviceModelChanges [TotalTime] took 13127 ms I have no idea why this happens, but DRS seems to be working correctly so far.
i've been thinking for a while to see whether or not the numa configuration of the majority of the VMs in the infrastructure currently fit their respective host numa node profiles. One way to do ... See more...
i've been thinking for a while to see whether or not the numa configuration of the majority of the VMs in the infrastructure currently fit their respective host numa node profiles. One way to do this would be to do the following get the vms cores / cores per socket = sockets Use 1 to go against the numa config of the host using get-esxcli Compare the two Then i saw this post: http://www.virtuallyghetto.com/2013/07/a-hidden-vsphere-51-gem-forwarding.html Is there any way to simply pull Vmware.log to see what the VM is actually using? From reading the 5.1 CPU Scheduler whitepaper i remember seeing that the VM will not resize the numa node once given, so not sure how much help this scirpt will be other than to prove we need to change provisioning practices.
Sounds promising but it doesn't work. Tried both -Global:$true and -Global
To be fair this never worked with PSSNAPPIN either; my work around at the moment is to place function Connect-VCenterServer and function Add-PowerCLI in DefaultProfile.ps1 and it works that way. ... See more...
To be fair this never worked with PSSNAPPIN either; my work around at the moment is to place function Connect-VCenterServer and function Add-PowerCLI in DefaultProfile.ps1 and it works that way. It seems as long as you do not import within an import you are fine. This is not a desirable state because that leaves duplicate code floating around.
Ive tried to do both, but it still does not work for me. Even Get-VM is not available. Have you got it to work with a 3-tier import as I have described above? SCRIPT 1: 1.) Call a mo... See more...
Ive tried to do both, but it still does not work for me. Even Get-VM is not available. Have you got it to work with a 3-tier import as I have described above? SCRIPT 1: 1.) Call a module A 2.) Call a function to connect to vi server in module A 3. ) inside function import module B (powerCLI) 4. ) inside script 1 powerCLI should now be available.
$PSautoLoadingPreference is null when I load the ISE. Yes, we have must moved to PS version 4.0. I'm not sure if I would want anything in here because it assumes that something is in $env:psmo... See more...
$PSautoLoadingPreference is null when I load the ISE. Yes, we have must moved to PS version 4.0. I'm not sure if I would want anything in here because it assumes that something is in $env:psmodulepath which I do not want. I would like everyone kept up to date via the NFS share we have setup for this.
i'm attempting to setup a 'Default Powershell Profile' for my fellow colleagues. I have so far wrote a function to determine the version of powercli and then load the module or pssnappin as appro... See more...
i'm attempting to setup a 'Default Powershell Profile' for my fellow colleagues. I have so far wrote a function to determine the version of powercli and then load the module or pssnappin as appropriate. Another function then calls this function and connects to default server locations depending on business rules. I place this in Vmware-Resources.psm1. I then have an auto-updating profile that people setup when they arrive at the company call it defaultProfile.ps1 1.) DefaultProfile.ps1 Imports VMwareResources.psm1     2.) VMwareResources.psm1 contains function named Add-PowerCLI and, connect-vcenterserver             3.) Default Profile calls Connect-VCenterServer which then calls Add-PowerCLI which imports module vmware.vimautomation.core and connects to different campuses depending on gui selection After this third step, i successfully connect to vcenter server; however, the resources in the module are not present (i.e. Get-VM or Get-VMhost). Basically the problem is as such: one cannot load a module within a module and get the commands from the second module. Anyone know how to get around this?
Also for VM config setup as well... .If we can get both working we can automate the setup across multiple hosts.
VSAN and vSphere Flash Read Cache cmdlets | VMware PowerCLI Blog - VMware Blogs Saw the above link but didnt see any such thing in later releases (the above link was posted in 2013). Does Vmwa... See more...
VSAN and vSphere Flash Read Cache cmdlets | VMware PowerCLI Blog - VMware Blogs Saw the above link but didnt see any such thing in later releases (the above link was posted in 2013). Does Vmware have other supported Flash Read Cache commandlets for host setup? Just curious. Thanks!
Hey Luc, I had sumilar thoughts, was only attached to one and only one vcenter server. $global:defaultviserver Name                           Port  User                      ----    ... See more...
Hey Luc, I had sumilar thoughts, was only attached to one and only one vcenter server. $global:defaultviserver Name                           Port  User                      ----                           ----  ----                      vcentertest                    443       - Edited user. Here we go... $Global:DefaultVIservers Name                           Port  User                       ----                           ----  ----                       vcentertest                    443                  vcentervsfrk                   443           vcentervsmke                   443                   For some reason it is connecting me to all 3 even though im only saying to connect to one. Is there any way to force it not to connect to all of them? connect-viserver -Server 'vcentertest' -Credential $admin -AllLinked:$false Yields the same results. EDIT: Got it to only one vi server by ensuring that it is only one that is connected to manually: Hit Line breakpoint on 'C:\temp\test.ps1:206' New-ResourcePool : 12/15/2014 7:20:06 AM    New-ResourcePool        The operation is not supported on the obje ct.   At C:\temp\test.ps1:87 char:31 +             $newPool = New-ResourcePool <<<<  -Confirm:$false -Location $Cluster -Name $name     + CategoryInfo          : NotSpecified: (:) [New-ResourcePool], NotSupported     + FullyQualifiedErrorId : Client20_ComputeResourceServiceImpl_NewResourcePool_ViError,VMware.VimAutomatio    n.ViCore.Cmdlets.Commands.NewResourcePool [DBG]: PS C:\temp>>> $global:DefaultVIServer Name                           Port  User                         ----                           ----  ----                         vcentertest                    443       ___________________________________________________________________________________________________________ [DBG]: PS C:\temp>>> $global:DefaultVIServers Name                           Port  User                         ----                           ----  ----                         vcentertest                    443                        Still get the same problem.
Yes DRS is enabled.
Also: PS: PS C:\temp>>> $name GeneralPop
Tried to create a resourcepool as seen below: Get-PowerCLIVersion PowerCLI Version ----------------    VMware vSphere PowerCLI 5.8 Release 1 build 2057893 $CLuster | gm    ... See more...
Tried to create a resourcepool as seen below: Get-PowerCLIVersion PowerCLI Version ----------------    VMware vSphere PowerCLI 5.8 Release 1 build 2057893 $CLuster | gm    TypeName: VMware.VimAutomation.ViCore.Impl.V1.Inventory.ClusterImpl New-ResourcePool -Confirm:$false -Location $Cluster -Name $name New-ResourcePool : 12/12/2014 1:24:00 PM    New-ResourcePool        The operation is not supported on the object.    At line:1 char:17 + New-ResourcePool <<<<  -Confirm:$false -Location $Cluster -Name $name     + CategoryInfo          : NotSpecified: (:) [New-ResourcePool], NotSupported     + FullyQualifiedErrorId : Client20_ComputeResourceServiceImpl_NewResourcePool_ViError,VMware.VimAutom    ation.ViCore.Cmdlets.Commands.NewResourcePool According to this it should accept base resource pool hosts or clusters: vSphere 5.5 Documentation Center  Ive tried all 3 and nothing. Also only connected to only one vCenter as ive seen that problem as well. Any suggestions?
no one has any hints or can tell me how the above script was written?
No, they are not in use. Files that are in use do not allow deletion; however, we run into the situation where files are more than a few months old left over on the server and the vm is on an o... See more...
No, they are not in use. Files that are in use do not allow deletion; however, we run into the situation where files are more than a few months old left over on the server and the vm is on an other host entirely with a seperate vswp file.
hello all, We have a lot of datatstores that have stale vswp files, as part of our weekly tasks, we would like to write some powershell script to go through and clean them up. Basically d... See more...
hello all, We have a lot of datatstores that have stale vswp files, as part of our weekly tasks, we would like to write some powershell script to go through and clean them up. Basically do the following; Scan through all datastores, find vswp files that are older than a month, attempt to delete them. Was looking at this: http://www.lucd.info/2011/04/25/orphaned-files-and-folders-spring-cleaning/ to see if we could use the same base code but im not sure where these methods are documented and how to write the search spec etc... Anyone have any idea how to write this code? Can i just get the datastore like a drive mount it and attempt to delete files greater than a month old with the file extension for a virtual swap file? Thanks!