Questions tagged [powercli]

VMware PowerCLI is a command-line and scripting tool built on Windows PowerShell

VMware PowerCLI is a command-line and scripting tool built on Windows PowerShell, and provides more than 600 cmdlets for managing and automating vSphere, vCloud, vRealize Operations Manager, vSAN, NSX-T, VMware Cloud on AWS, and VMware Horizon environments.

Resource for Downloads and Documentation and Reference

79 questions
10
votes
4 answers

VMWare ESXi: how to add network drivers to installation?

Background / Problem I have two new servers (Dell R720 & Dell R520) that I plan to install ESXi onto. During the VMWare Hypervisor installation, I'm told that no network adapters exist. Upon checking, I realized that the Broadcom NetXtreme I…
SeanKilleen
  • 1,073
  • 8
  • 25
  • 38
9
votes
3 answers

ESXcli command timeout at 30 minutes

I am working on a powercli script to loop through each datastore in our environment and reclaim space on the thin provisioned LUNs. All LUNs in the environment are Dell Equal Logic. vCenter version: 5.5.0_1750787 ESXi version: Dell…
Lars
  • 198
  • 1
  • 10
6
votes
2 answers

Setting a VM boot CD via PowerCLI

I have a sneaking suspicion that this may be a bug, but I'm definitely willing to entertain the possibility that I'm doing things wrong. I have a VMware virtual machine in $vm, and I'm trying to assign a boot CD for it. $vm is powered off. The…
Matt Simmons
  • 20,218
  • 10
  • 67
  • 114
5
votes
1 answer

Checking partition alignment with PowerCLI

I'm trying to verify that the file system partitions within each of the servers I'm working on are aligned correctly. I've got the following script that when I've tried running will either claim that all virtual servers are aligned or not aligned…
Valrok
  • 330
  • 3
  • 11
4
votes
1 answer

Can you list a Datastore Cluster's sDRS Schedule via PowerCLI?

We have a lot of datastore clusters, most if not all are supposed to have sDRS schedules applied to stop them moving VMs at busy periods. Obviously we could trawl through them manually to check if they're how they should be but I like to do things…
Chopper3
  • 100,240
  • 9
  • 106
  • 238
4
votes
4 answers

How do I open the VMware Remote Console (application) from the PowerCLI?

A recent update to ESXi in our environment added a feature, "Open with VMRC". This works outside the browser, and as the method of accessing the console that functions inside the browser hasn't worked in my Chrome for months, this removal of a…
mojo
  • 217
  • 1
  • 4
  • 12
4
votes
3 answers

How can I get triggered alarms using PowerCLI?

In vSphere Client on a VM host in the Alarms tab there is a view of Triggered Alarms. How can I get those alarms using PowerCLI?
Andrew J. Brehm
  • 1,611
  • 7
  • 34
  • 57
4
votes
1 answer

Modifying the number of VCPUs in a VMware VM

In ESXi, what is the automation/script (I expect it would be using PowerCLI somehow) approach to modify the number of VCPUs in a VM? In context, when using our kickstarts, RHEL won't install the SMP kernel unless there is more than one CPU on the…
warren
  • 17,829
  • 23
  • 82
  • 134
4
votes
1 answer

How do I shutdown the Host over ssh on ESXi 5 so it shuts down the guests properly?

I have ssh login to an ESXi 5 host. All the guests have vmware tools running, so they can be shut down by the host properly. I would like an equivalent for this menu option in vSphere client: It shuts down all the guests automatically (if they…
mit
  • 1,844
  • 6
  • 29
  • 42
4
votes
4 answers

PowerCLI: Run commands in virtual-machine

We have several view-desktops and I need a script to be performed once on all desktops. Sadly, WMI is disabled. These desktop are all running Windows XP SP3 I thought I read about the possibility to execute commands in a guest-vm via VMwares…
wullxz
  • 1,023
  • 2
  • 15
  • 29
3
votes
2 answers

Rapid deployment of similar VMs

We're rolling out a new testbed in the office, and need to spin up ~30-40 Linux VMs (mostly RHEL 5/6, some SuSE). Running on VMware ESXi 5.5, we'd like to automate the process. There's a pre-made answer file for the installer, the question is how to…
3
votes
1 answer

PowerCLI automation set-cddrive error

When attempting to change ISOs on a powered on guest instance, set-cddrive is returning an error but completing the command. A couple different commands produce the same result: $theVM | Get-CDDrive | Set-CDDrive -NoMedia -Confirm:$false $theVM |…
Devnull
  • 951
  • 1
  • 7
  • 23
3
votes
3 answers

PowerCLI Move-VM Returns failure but vm still moves

I have a script that is moving VM's from one datastore to another. I have other logic to protect the Storage backend and fabric from over subscription and to wait to submit new requests at specific times (Business requirement). I am only moving…
TechGuyTJ
  • 782
  • 1
  • 12
  • 25
3
votes
3 answers

Is it possible to add root ssh keys to /etc/ssh/keys-root/authorized_keys on ESX hosts without having to log into every box?

I have close to 70 ESX hosts that need to have the root SSH keys added to them. Is there a way to do this through vsphere or powercli, or will I have to manually SSH into each box and add the line to each file?
EGr
  • 575
  • 3
  • 12
  • 29
3
votes
2 answers

Query ESXi memory slots/installed memory modules from PowerCLI 4.1

I have a VMware infrastructure with some ESXi 4.1 hosts and a vCenter Server 5.0 installed. I need to extend our hardware inventory with the following info: how many memory slots are available in each ESXi host how many and what type (DDR2/DDR3,…
Zizzencs
  • 937
  • 1
  • 10
  • 22
1
2 3 4 5 6