Powercli to list & delete snapshots

We have realized we are having broken NetApp VMs backup. The process left a lot of VM snapshots. To start off let’s find out those snaps with: get-vm | get-snapshot | where {$_.Description -match "SMVI Snapshot generated for backup"}| Format-Table…

Disable FC adapter (qla2xxx) in SystemRescueCD

During the boot of SystemRescueCD hit TAB and append: noload=qla2xxx,scsi_transport_fc,scsi_tgt

PowerCLI to start and stop Remote Tech Support (SSH)

Another PowerCLI one-liner to start Remote Tech Support (SSH) on ESX/ESXi: Get-Cluster -Name "CIT2 CLuster" | Get-VMHost | Get-VMHostService | ? {$_.Key -eq "TSM-ssh"} | Start-VMHostServiceGet-Cluster -Name "CIT2 CLuster" | Get-VMHost | Get-VMHostService | ? {$_.Key -eq "TSM-ssh"} | Start-VMHostService…

Get VM ethernet info and state

PowerCLI > Get-VM -Name builder2 | Get-NetworkAdapter| Format-List -Property *     MacAddress : 00:50:56:90:34:9d WakeOnLanEnabled : True NetworkName : Network 158.196.149.0 Type : e1000 ParentId : VirtualMachine-vm-4650 Parent : builder2 Uid : /VIServer=administrator@vcs1.vsb.cz:443/VirtualMachine=Virtu alMachine-vm-4650/NetworkAdapter=4000/ ConnectionState : Connected, GuestControl, StartConnected…

Disconnect all mounted CD-ROMs in VMware cluster

PowerCLI > Get-VM | Get-CDDrive | Set-CDDrive -NoMedia -Confirm:$falsePowerCLI > Get-VM | Get-CDDrive | Set-CDDrive -NoMedia -Confirm:$false

Get VMs with disconnected virtual ethernet

PowerCLI > Get-NetworkAdapter (get-vm | where {$_.powerstate -eq “poweredon”}) | Where { $_.connectionstate.connected -eq “$null” } | select parent, connectionstate   Parent ConnectionState —— ————— licenser NotConnected, GuestControl, NoStartC…PowerCLI > Get-NetworkAdapter (get-vm | where {$_.powerstate -eq “poweredon”}) | Where {…

PowerCLI to add vlan to vmware cluster

One-liner to add VLANs to the all hosts within vSphere cluster: Get-Cluster "CIT Cluster" | Get-VMHost | Get-VirtualSwitch -name vSwitch0 | New-VirtualPortGroup -name "Networking – Vlan80" -VLanId 80Get-Cluster "CIT Cluster" | Get-VMHost | Get-VirtualSwitch -name vSwitch0 | New-VirtualPortGroup -name "Networking…

Create ESXi 4.0 USB stick with dd on Linux

These are the steps to create ESX 4.0 USB stick: mount -o loop VMware-VMvisor-Installer-4.0.0.update04-504850.x86_64.iso /mnt/ cp /mnt/image.tgz . tar xvzf image.tgz bunzip2 usr/lib/vmware/installer/VMware-VMvisor-big-4.0.0-504850-x86_64.dd.bz2 dd if=usr/lib/vmware/installer/VMware-VMvisor-big-4.0.0-504850-x86_64.dd of=/dev/sdb rm -r usr umount /mntmount -o loop VMware-VMvisor-Installer-4.0.0.update04-504850.x86_64.iso /mnt/ cp /mnt/image.tgz . tar xvzf…

Create ESXi 4.1 USB stick with dd on Linux

These are the steps to create ESX 4.1 USB stick: mount -o loop VMware-VMvisor-Installer-4.1.0.update02-502767.x86_64.iso /mnt/ cp /mnt/imagedd.bz2 . bunzip2 imagedd.bz2 dd if=imagedd of=/dev/sdb rm imagedd umount /mntmount -o loop VMware-VMvisor-Installer-4.1.0.update02-502767.x86_64.iso /mnt/ cp /mnt/imagedd.bz2 . bunzip2 imagedd.bz2 dd if=imagedd of=/dev/sdb rm…

How to remove sw raid for VMware Converter to work

VMWare converter is very powerful tool to provide physical to virtual conversion. It’s quite easy to make P2V of Windows base servers. The last versions of VMware Converter claim to support P2V of Linux based servers. This is true, but…

Fork me on GitHub