VMware Cloud Community
chicojr
Enthusiast
Enthusiast
Jump to solution

Powershell new virtual machine

Were on Vsphere 6.7.0, seeing if anyone has a sufficient script to run that will go through and create one virtual machine with 2 cpu, 8gb of ram, 75gb disk and to select "datastore Default", select vm guest os = Microsoft windows server 2012 (64bit), specify destination, specify target and name server,

Tags (1)
Reply
0 Kudos
1 Solution
4 Replies
timweaver23
Enthusiast
Enthusiast
Jump to solution

Something like this ....

New-VM -Name [server name] -Datastore [datastore name] -DiskGB [size] -DiskStorageFormat [disk format thin\thick] -MemoryGB [size] -CD -GuestId [guestos] -NumCpu [number]

Reply
0 Kudos
HassanAlKak88
Expert
Expert
Jump to solution

Hello,

Kindly find the following:

In PowerCLI, the New-VM cmdlet is used to create a new virtual machine. A few important things that can be set with New-VM are the following:

Run New-VM while specifying the VM name, VMHost, datastore, number of CPU's, hard disk size and the network name.

Example:

New-VM -Name 'TestVM' –VMHost 'VMHost-1' -Datastore 'TestDatastore' -DiskGB 40 -MemoryGB 8 -NumCpu 2 -NetworkName 'Virtual Machine Network'

Please consider marking this answer "CORRECT" or "Helpful" if you think your question have been answered correctly.

Cheers,

VCIX6-NV|VCP-NV|VCP-DC|

@KakHassan

linkedin.com/in/hassanalkak


If my reply was helpful, I kindly ask you to like it and mark it as a solution

Regards,
Hassan Alkak
Reply
0 Kudos
jacobvanderwyst
Contributor
Contributor
Jump to solution

Can you update with functioning links?

Reply
0 Kudos