Book Image

Learning PowerCLI for VMware VSphere

By : Robert van den Nieuwendijk
Book Image

Learning PowerCLI for VMware VSphere

By: Robert van den Nieuwendijk

Overview of this book

Table of Contents (17 chapters)
Learning PowerCLI
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a virtual machine


There are several ways in which you can create a new virtual machine, such as:

  • Deploying a virtual machine from a template

  • Cloning another virtual machine

  • Using VMware vCenter Converter to convert a physical computer to a virtual machine (P2V)

  • Building a new virtual machine from scratch using traditional methods such as an installation CD-ROM or ISO file to install the operating system

To create a new virtual machine using PowerCLI, you have to use the New-VM cmdlet. The New-VM cmdlet has the following syntax containing four parameter sets.

The default parameter set is shown in the following command line:

New-VM [-AdvancedOption <AdvancedOption[]>] [[-VMHost] <VMHost>] [-Version <VMVersion>] -Name <String> [-ResourcePool <VIContainer>] [-VApp <VApp>] [-Location <Folder>] [-Datastore <StorageResource>] [-DiskMB <Int64[]>] [-DiskGB <Decimal[]>] [-DiskPath <String[]>] [-DiskStorageFormat <VirtualDiskStorageFormat...