VM 서버들을 여러 대 운용하다 보면 각 VM이 어떤 ip를 사용하는 지 확인이 필요할 때가 있다.
vSphere Web UI를 이용해서 찾으려 해도 그 수가 많으면 찾는데 시간이 오래 걸릴 뿐더러 vm tool 이 설치되지 않은 VM 이라면 찾기는 더더 욱 힘들다.
이럴때 PowerCLI를 이용하여 간편하게 VM들의 ip를 한눈에 확인 할 수 있다.
Vmwere PowerCLI 설치하기
관리자권한으로 윈도우 powershell 을 실행 후
> Find-Module -Name VMware.PowerCLI

> Install-Module -Name Vmware.PowerCLI -Scope CurrentUser > Get-Module VMware* -ListAvailable

아래의 접속 명령으로 접속 하면 하기처럼 오류가 발생 할 수 있는데
> Connect-VIServer -Server 192.168.1.135 -Protocol https -User Administrator -Password pass123

아래 명령으로 인증 관련 옵션을 수정 한 후 다시 접속 해 보자
> Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
그런 다음 아래 명령을 실행하면 VM 목록 과 사용중인 IP 정보를 확인 할 수 있다.
Get-VM | Select Name, @{N="IP Address";E={@($_.guest.IPAddress[0])}}
