Beans recently took over some ESXi 5.0, which has many virtual machines, but the SCSI drivers for these VMs are still using older versions such as Lsibasci,lsisas and so on. I want to update them to paravirtual driver, the Update method is very simple, manually add a hard disk and SCSI drive, select Paravirtual, and so on, the operating system recognized the hard drive will indicate that the driver has been automatically installed, Then delete this new hard drive and modify the drive type on the boot disk.
But first I have to get the SCSI and operating system type of all the VMS to facilitate the next steps.
Connecting vcenter is easy, download the corresponding powercli, and add Snappin on the line. If you do not bother to do it every time, you can configure it to automatically load every time you start the Ise in PowerShell profile.
Add-pssnapin VMware.VimAutomation.Core
You can then connect to vcenter to see the type. The statement itself has nothing to say, I used a tee to save the variable so that I can see the results on the screen at the same time. Finally, the results are exported.
Connect-viserver SYDVCS2012GET-VM | Select Version,name, PowerState, Numcpu, MEMORYGB, @{n= "IP address"; e={@ ($_.guest. Ipaddress[0])}},@{n= "OS"; E={$_.guest.osfullname}, @{n= "SCSI"; e={(Get-scsicontroller $_.name). Type} | Tee-variable Result$result | Sort SCSI | Export-csv C:\temp\mel.csv-NoTypeInformationDisconnect-VIServer
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7C/D3/wKiom1bY1knRRZtOAAD4EnyHjfU539.png "title=" 3.PNG " alt= "Wkiom1by1knrrztoaad4enyhjfu539.png"/>
It is worth mentioning that GET-VM at the beginning of a few problems, because I also installed the Hyper-V module, Hyper-V also has GET-VM this command. Sometimes PowerShell is confused about which module I need to command.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7C/D2/wKioL1bY1laQ_p_XAAAXV2S_PI8584.png "style=" float: none; "title=" 1.PNG "alt=" Wkiol1by1laq_p_xaaaxv2s_pi8584.png "/>
If you need to prefix the module name to avoid confusion, there will be no conflict.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7C/D3/wKiom1bY1d2RoGNXAABLUdTLKKA899.png "style=" float: none; "title=" 2.PNG "alt=" Wkiom1by1d2rognxaabludtlkka899.png "/>
This article is from the "Mapo Tofu" blog, please be sure to keep this source http://beanxyz.blog.51cto.com/5570417/1747412
PowerShell CLI gets VM information