Categories: PowerCLI

Understand Basic Commands – vSphere Power CLI

Understand Basic Commands – vSphere Power CLI

After Connecting to vCenter from POwer CLI Follow below commands
List Datacenter Inventory
> Get-Datacenter
Name
—-
DATACENTER NAME
List Cluster Inventory
> Get-Cluster
Name           HAEnabled  HAFailover DrsEnabled DrsAutomationLevel
                                        Level
—-           ———  ———- ———- ——————
Cluster Name   True       0          False      FullyAutomated
List Complete HOST Inventory
> Get-VMHost
Name    Connection PowerState NumCpu CpuUsage CpuTotal  Memory   Memory    Version
              State                                                    MhzMhz                      UsageGB  TotalGB
—-    ———– ——-   —– ——- ——–   ——–   ——– ——
esxi-01 Connected   PoweredOn     8                387           19200      24.840    159.990         6.0.0
esxi-02 Connected   PoweredOn    8                 2730         19200      48.579    159.990         6.0.0
List Complete VM Inventory
> Get-VM        
Name                 PowerState Num CPUs MemoryGB
—-                 ———- ——– ——–
TESTVM                PoweredOn   4        4.000
List Datastore Inventory
>Get-Datastore
Name                   FreeSpaceGB   CapacityGB
——-                   —————-   ————-
esxi-01(Local)     130.802                131.750
esxi-02(Local)    130.802                131.750
List vswitch Inventory
> Get-VirtualSwitch
Name                           NumPorts   Mtu   Notes
——-                           ————   —–   ——-
vSwitch0                       3072         1500
vSwitch1                       3072          1500
List Portgroup Inventory
> Get-VirtualPortGroup
Name                  Key                                                                   VLanId
———–            ——–                                                              ——–
VmNeetwork1  Key-vim.host.PortGroup-VmNeetwork1   122
VmNeetwork2  key-vim.host.PortGroup-VmNeetwork2   123

Generate complete snapshot inventory with few details

> get-vm | Get-Snapshot

Name                       Description                                                         PowerState
——–                      ———–                                                             ————-
VM Tools                                                                                               PoweredOn
VM Tools                                                                                               PoweredOn
Restore Point       Avamar Snapshot generated for back             PoweredOff

Rajesh Radhakrishnan

Share
Published by
Rajesh Radhakrishnan

Recent Posts

NAKIVO Backup & Replication v10.8 Released With New Features

Nakivo has released its new Backup and Replication solution Nakivo v10.8, which includes support for…

1 year ago

Oracle Cloud VMware Solution and Features

Oracle Cloud VMware Solution (OCVS) provides a customer-managed, native VMware-based cloud environment hosted in Oracle…

2 years ago

Vinchin Backup and Recovery Review

Vinchin is a professional provider of data protection solutions for enterprises. It provides a series…

2 years ago

VMware Cloud Disaster Recovery (VCDR) Solution Deployment And Configuration Part 2

In my previous blog post, I have explained about VMware Cloud Disaster Recovery (VCDR) Onboarding and…

2 years ago

How to Deploy vRNI Cloud With VMC on AWS

vRealize Network Insight helps you build an optimized, highly available, and secure network infrastructure across…

2 years ago

This SysAdmin Day, WIN with Hornetsecurity!

Can you believe it's here again? SysAdmin Day is back, and with it comes endless gratitude…

2 years ago