EKardinal's Posts

Hi, Are there any Snapshots on the VM? A Snapshot also keeps the old network informations and you'll see both networks in the summary view. Regards
Thank you very much! This is a great way of improving the readability of PowerShell Code in the posts. Looks very good.
Hi, you can use the ExtensionData of $VM as well. Get-Cluster "Cluster" | Get-VM | Where-Object { $_.ExtensionData.Snapshot.RootSnapshotList.Count -gt 0 } | Select-Object -Property `     N... See more...
Hi, you can use the ExtensionData of $VM as well. Get-Cluster "Cluster" | Get-VM | Where-Object { $_.ExtensionData.Snapshot.RootSnapshotList.Count -gt 0 } | Select-Object -Property `     Name,     @{N="Snapshot", E=@{$_.ExtensionData.Snapshot.RootSnapshotList[0].Name}},     @{N="Snapshot Description", E=@{$_.ExtensionData.Snapshot.RootSnapshotList[0].Description}} Lists all VMs with one or more snapshots and their first snapshot name and description. Regards Emanuel
Hmm, curios. DNS works, services are up. Are you using a proxy server in the internet settings on the vCenter Host or the PowerCLI Host? Have you already restarted the whole vCenter Host? ... See more...
Hmm, curios. DNS works, services are up. Are you using a proxy server in the internet settings on the vCenter Host or the PowerCLI Host? Have you already restarted the whole vCenter Host? Could you connect with the Connect-VIServer directly to a host and try it again? Just to note: Your link is stating to your internal address and datastore. Better remove it Regards Emanuel
Hi, The term you are searching for is VAAI. VMware KB: Frequently Asked Questions for vStorage APIs for Array Integration If your storage is supported, look here http://www.emc.com/colla... See more...
Hi, The term you are searching for is VAAI. VMware KB: Frequently Asked Questions for vStorage APIs for Array Integration If your storage is supported, look here http://www.emc.com/collateral/hardware/technical-documentation/h10554-dp-isilon-vsphere5-deployment.pdf Regards Emanuel
Hi, PS D:\Users\myuserid> Copy-DatastoreItem D:\filename.iso $ds.DatastoreBrowserPath -Recurse You don't need the -Recurse param if specifying a single file. But this shouldn't cause the... See more...
Hi, PS D:\Users\myuserid> Copy-DatastoreItem D:\filename.iso $ds.DatastoreBrowserPath -Recurse You don't need the -Recurse param if specifying a single file. But this shouldn't cause the error. Could you verify, that all required ports are open on the vCenter Server? Look page 18 & 19 at http://www.vmware.com/pdf/vsphere4/r41/vsp_41_esxi_i_vc_setup_guide.pdf Also check the vCenter services via vSphere Client "Home => Administration => vCenter Service Status". This was working up until about 3 weeks ago ! Uploading via the vcenter client is working fine. If you upload data through the vSphere client, you are going to establish a direct connection with a host that has access to the datastore. PowerCLI uploads the data to the vCenter Server which sends it to a host. According to this, get the output of $ds.DatastoreBrowserPath and try to resolve the given url via nslookup. (Not the whole, just the FQDN after vmstores://) Regards Emanuel
Hi assuming this is your csv file     "name","ip","netmask","gateway","dns","networkName"     "TESTSRV1","10.244.186.136","255.255.255.0","10.244.186.1","10.244.37.25;10.244.37.26","VLAN1... See more...
Hi assuming this is your csv file     "name","ip","netmask","gateway","dns","networkName"     "TESTSRV1","10.244.186.136","255.255.255.0","10.244.186.1","10.244.37.25;10.244.37.26","VLAN186_QA" you have one problem. You can't save any arrays into a csv and make powershell recognize them natively. Instead, use a custom delimiter (not the same as csv uses!) and split them - at import - into an array. Look at the semicolon between the two dns servers.     $newVmList = Import-Csv test.csv | Select-Object -Property "name", "ip", "netmask", "gateway", @{Name = "dns"; Expression = {$_.dns -split ";"} }, "networkName" The resulting object looks like this     name       : TESTSRV1     ip         : 10.244.186.136     netmask    : 255.255.255.0     gateway    : 10.244.186.1     dns        : {10.244.37.25, 10.244.37.26} <-- Array     networkName: VLAN186_QA Regards Emanuel
I'm glad to hear that, because I had no additional idea anymore. Just for interest, did VMware knew some solution or why this was happen?
To uninstall the PowerCLI View Snapin, run the following PowerShell script "%programfiles%\VMware\VMware View\Server\extras\PowerShell\uninstall-snapin.ps1" and after that, the add-snapin.ps1 i... See more...
To uninstall the PowerCLI View Snapin, run the following PowerShell script "%programfiles%\VMware\VMware View\Server\extras\PowerShell\uninstall-snapin.ps1" and after that, the add-snapin.ps1 in the same directory to reinstall it. Could you also fire the Get-Pool command once again and directly after the following and post the output $Error[0].Exception | Select-Object -Property *
Hi, Try to run this command in a normal powershell session (don't use the ViewCLI Shortcut): Add-PSSnapin "VMware.View.Broker" Do you see any errors? If not, have you already reinstalled... See more...
Hi, Try to run this command in a normal powershell session (don't use the ViewCLI Shortcut): Add-PSSnapin "VMware.View.Broker" Do you see any errors? If not, have you already reinstalled the ViewCLI? Are there any additional commands in your Profile.ps1? Windows PowerShell Profiles Regards Emanuel
My console output, tested on one VM with two external nics and a internal 'dummy' interface Name                               IP                                  MAC ----                    ... See more...
My console output, tested on one VM with two external nics and a internal 'dummy' interface Name                               IP                                  MAC ----                                   --                                    --- VM1                                192.168.1.1                     00:50:56:xx:xx:xx VM1                                192.168.2.1                     00:50:56:xx:xx:xx VM1                                192.x.x.xxx                     xx:xx:xx:xx:xx:xx Do you see any of the expected addresses in the VM summary using vSphere Client? Ah sorry, I forgot about the PS 3.0 requirement. You could put every entry into an array and export the whole at the end of the script.      $out = @()      $VMs = Get-Datacenter $DC | get-vmhost | Get-VM      foreach ($VM in $VMs) {          $VMx = Get-View $VM.ID          $HW = $VMx.guest.net          foreach ($dev in $HW)          {              foreach ($ip in $dev.ipaddress)              {                  $out += $dev | select @{Name = "Name"; Expression = {$vm.name}}, @{Name = "IP"; Expression = {$ip}}, @{Name = "MAC"; Expression = {$dev.macaddress}}              }          }      }      $out | Export-Csv -NoTypeInformation -Path "VM-IP-Info.csv" Regards Emanuel
Hi, try it with the -Append param on Export-CSV http://technet.microsoft.com/en-us/library/hh849932.aspx I got the correct output, when I put your whole select into one single line. Did y... See more...
Hi, try it with the -Append param on Export-CSV http://technet.microsoft.com/en-us/library/hh849932.aspx I got the correct output, when I put your whole select into one single line. Did you forgot the single backtick on the first line $dev | select ` ? Are you sure the other nic has an IP assigned and is enabled in the GuestOS? If it's not, it won't even run into the third foreach. Regards Emanuel
$Name is defined only within the foreach. You can't use it outside. To customize the network, you have two possibilities. -- The simple one Enter for every VM the appropriate command ... See more...
$Name is defined only within the foreach. You can't use it outside. To customize the network, you have two possibilities. -- The simple one Enter for every VM the appropriate command into the script (Set-NetworkAdapter and Set-VMGuestNetworkInterface) => Just copy/paste and adjust the ip addresses. This will get very unhandy with increasing VM count. -- The complex one Adjust the $newVmList to an array, with a hash table for each vm containing the network data, and loop through (same as you did before). With this method, you also could provide the VM data from a csv file or an other source. But you should get used with hash tables, otherwise it could be confusing. Windows PowerShell Tip: Working with Hash Tables $newVmList = @(     @{"Name" = "SRV01"; "IP" = "192.168.1.100"; "Netmask" = "255.255.255.0"; "Gateway" = "192.168.1.1"; "DNS" = @("192.168.1.2", "192.168.1.3"); "NetworkName" = "VM2"; },     @{"Name" = "SRV02"; "IP" = "192.168.1.101"; "Netmask" = "255.255.255.0"; "Gateway" = "192.168.1.1"; "DNS" = @("192.168.1.2", "192.168.1.3"); "NetworkName" = "VM2"; },     @{"Name" = "SRV03"; "IP" = "192.168.1.102"; "Netmask" = "255.255.255.0"; "Gateway" = "192.168.1.1"; "DNS" = @("192.168.1.2", "192.168.1.3"); "NetworkName" = "VM2"; },     @{"Name" = "SRV04"; "IP" = "192.168.1.103"; "Netmask" = "255.255.255.0"; "Gateway" = "192.168.1.1"; "DNS" = @("192.168.1.2", "192.168.1.3"); "NetworkName" = "VM2"; } ) Then you have to make a small change to the New-VM foreach. Should then look like this foreach($VM in $newVmList) {     $taskTab[(New-VM -Name $VM.Name -VMHost (Get-VMHost -Name $esxName) -Template $template -Datastore $datastore -OSCustomizationSpec $custSpec -Location $location -RunAsync).Id] = $VM.Name } After the Start-Sleep -Seconds 300, you could loop through the $newVmList again to customize the network for each VM. foreach($VM in $newVmList) {     Get-NetworkAdapter -VM $VM.Name | Set-NetworkAdapter -NetworkName $VM.NetworkName -Confirm:$false     Get-VM -Name $VM.Name | Get-VMGuestNetworkInterface -Guestuser "Administrator" -GuestPassword "MYPASSWORD" | ? { $_.name -eq "Local Area Connection 3" } | Set-VMGuestNetworkInterface -Guestuser "Administrator" -GuestPassword "MYPASSWORD" -IPPolicy static -IP $VM.IP -Netmask $VM.Netmask -Gateway $VM.Gateway -DNS $VM.DNS } Regards Emanuel
The key difference between the two methods seems to be the protocol used for transport. When you browse the datastore through the vSphere Client, it uses NFC - TCP 902 to connect directly to t... See more...
The key difference between the two methods seems to be the protocol used for transport. When you browse the datastore through the vSphere Client, it uses NFC - TCP 902 to connect directly to the esx host. All communication is between the client and the host. If you check the value returned by (Get-Datastore "nfs99").DatastoreBrowserPath or (Get-PSDrive "dsIso").Root, which is also used by the Copy-DatastoreItem cmdlet as target, you'll see something like vmstores:\vCenter.domain.com@443\Datacenter\Datastore. I assume, the PowerCLI is using a tunnel through the vCenter on port TCP 443, of course encrypted with ssl. This results in the slow download/upload speed. Update: Found someone, who explains the way the data takes. Copy-DatastoreItem - Understanding the Traffic Flow | Technodrone A workaround could be to connect directly to the esx host, maybe via ssh, and copy the file to /vmfs/volumes/nfs99/winpe_x64_$SrvName.iso Regards Emanuel
This would work, too. I prefer to put every condition, I'd like to check, into round brackets. This helps to differentiate the conditions from each other and also to build nested statements w... See more...
This would work, too. I prefer to put every condition, I'd like to check, into round brackets. This helps to differentiate the conditions from each other and also to build nested statements with multiple -and -or. You can find a short overview about the bracket types with some basic tutorials and a short explanation: Windows PowerShell Brackets (Parenthesis), {braces}, [square] brackets. Regards Emanuel
Hi, foreach($vm in (Get-VM | Where-Object { ($_.PowerState -eq "PoweredOff") -and ($_.Guest.GuestId -eq "windows7Server64Guest") })) {      Enable-MemHotAdd $vm      Enable-vCpuHotAdd $v... See more...
Hi, foreach($vm in (Get-VM | Where-Object { ($_.PowerState -eq "PoweredOff") -and ($_.Guest.GuestId -eq "windows7Server64Guest") })) {      Enable-MemHotAdd $vm      Enable-vCpuHotAdd $vm } http://www.vmware.com/support/developer/converter-sdk/conv50_apireference/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html windows7Server64Guest is the equivalent to Microsoft Windows Server 2008 R2 (64-bit) You could also use $_.Guest.OSFullName which should be the same as the Guest OS selection values. In the above case Microsoft Windows Server 2008 R2 (64-bit) Regards Emanuel
I've done nearly the same in my script and it's working like a charm. https://communities.vmware.com/message/2280500#2280500 The only difference I can see is the way of passing arguments into... See more...
I've done nearly the same in my script and it's working like a charm. https://communities.vmware.com/message/2280500#2280500 The only difference I can see is the way of passing arguments into the Job. Regards Emanuel
Since vSphere 5.1, you could hot migrate a VM between datastores and hosts in one step. But that feature is only enabled in the vSphere Web Client and I think, the PowerCLI needs a few more up... See more...
Since vSphere 5.1, you could hot migrate a VM between datastores and hosts in one step. But that feature is only enabled in the vSphere Web Client and I think, the PowerCLI needs a few more updates to provide this feature as well. Until then, you have to use two scripts to change datastore and host.
Paste your code starting at Start-Sleep -Seconds 300 after the whole while loop. Should look like this # Create Vms foreach($Name in $newVmList) {      ... } # Start each ... See more...
Paste your code starting at Start-Sleep -Seconds 300 after the whole while loop. Should look like this # Create Vms foreach($Name in $newVmList) {      ... } # Start each VM that is completed $runningTasks = $taskTab.Count while($runningTasks -gt 0) {      ... } # START HERE # Wait for OS Customization Start-Sleep -Seconds 300 # Customize network get-vm "TEST-SRV01" | Get-VMGuestNetworkInterface -Guestuser Administrator -GuestPassword "MYPASSWORD" | ? ............... Regards Emanuel
I would use the Shutdown-VMGuest cmdlet whenever it's possible (VMware Tools installed) instead of Stop-VM, especially on production VMs.