Reader small image

You're reading from  Mastering PowerCLI

Product typeBook
Published inOct 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781785286858
Edition1st Edition
Languages
Right arrow
Author (1)
Sajal Debnath
Sajal Debnath
author image
Sajal Debnath

Sajal Debnath is a highly certified Cloud computing technocrat with more than 12 years of experience in virtualized data center design, Cloud computing, and BC/DR solutions. He is an EMCISA, VCAP-DCD/DCA, VCAP-CID/CIA, RHCE 4/5/6, RHCVA, Openstack, and ITIL certified person. He is presently associated with VMware Software India Pvt. Ltd. as a senior system engineer. Previously, he worked with France Telecom, Hewlett Packard, and many more in multiple roles. He is involved in prestigious Indian government projects, such as National Cloud, Digital Locker, and so on.
Read more about Sajal Debnath

Right arrow

Creating virtual machines


We will use the following cmdlets to manage the different aspects of managing a virtual machine in a vSphere environment using PowerCLI cmdlets:

  • Get-VM

  • Move-VM

  • New-VM

  • Remove-VM

  • Set-VM

We will start by creating a simple virtual machine. To do this, we will use the New-VM cmdlet:

PS C:\> New-VM -Name Test3 -ResourcePool Mgmt -Datastore iSCSI-4 ` -NumCPU 1 -MemoryGB 1 -DiskGB 10 -NetworkName "VM Network" `
–Floppy -CD -DiskStorageFormat Thin -GuestID winNetDatacenterGuest

Name                 PowerState Num CPUs MemoryGB       
----                 ---------- -------- --------       
Test3                PoweredOff 1        1.000   

The output will be as follows:

Note that the ResourcePool parameter accepts ResourcePool, Cluster, VApp, and standalone VMHost as input options. For example, in the following screenshot, I am creating a VM directly under the cluster, Lab Cluster:

We can use the Get-VM cmdlet to check the list of available VMs or a particular VM:

PS...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering PowerCLI
Published in: Oct 2015Publisher: PacktISBN-13: 9781785286858

Author (1)

author image
Sajal Debnath

Sajal Debnath is a highly certified Cloud computing technocrat with more than 12 years of experience in virtualized data center design, Cloud computing, and BC/DR solutions. He is an EMCISA, VCAP-DCD/DCA, VCAP-CID/CIA, RHCE 4/5/6, RHCVA, Openstack, and ITIL certified person. He is presently associated with VMware Software India Pvt. Ltd. as a senior system engineer. Previously, he worked with France Telecom, Hewlett Packard, and many more in multiple roles. He is involved in prestigious Indian government projects, such as National Cloud, Digital Locker, and so on.
Read more about Sajal Debnath