Search This Blog

Friday, May 27, 2011

CREATING A VM USING PowerCLI


Creating a vm ushing powercli

·         Default parameter set
Required parameters
Name
Vmhost
Common optional parameters
Resource pool
Location
Datastore
Diskmb
Memorymb
Numcpu
Networkname

Practical:
Connect to the server

Connect-VIServer    -Server <ipadress or DNS name>   or
Connect-VIServer    -Server <ipadress>  -Protocol   https –User  admin(root)   -Password <something>
To Disconnect: Disconnect-VIServer

$cred = Get-Credential   (storing the credentials in a variable)

We will get a popup window to give the credentials
Connect-VIServer    -Server <ipadress or DNS name>   or
Connect-VIServer    -Server <ipadress>  -Protocol   https –User  admin(root)   -Password <something>
Next:
>get-Vmhost
Select the host where you want to store the vm
Creation of new vm
>New-vm –name test1 –vmhsost esx1.example.com –diskmb 4  -memorymb 100

>New-vm –name test1 –vmhsost esx1.example.com –diskmb 4  -memorymb 100 –runasync

It will give immediate results of that task

Help:
>new-vm -? | More

>get-resourcepool

Select one of the resourcepool

>New-vm –name test1 –vmhsost esx1.example.com -resourcepool development –diskmb 4  -memorymb 100

No comments:

Post a Comment