VMware Cloud Community
noaboa
Contributor
Contributor
Jump to solution

PowerCLI New-VM can't create new VM - Null Error Message

Hello,

So I've been looking into PowerCLI and wrote a Script which automaticly creates a VM. I tested in my Testlab an there it worked perfectly.

I then proceeded to test it in the productive enviroment which is a vCenter 6.5 there I get the Null Error from the New-VM cmdlt.

On the second productive vCenter 6.0 it works fine and also in my testlab with vCenter 6.7 installed.

I've read a few community post where other people have those problem but they didn't pass the portgroup parameter.

I passed the parametes Name, PortGroup, ResourcePool and Datastore. I also tired it with NetworkName instead of PortGroup and/or VMHost instead of ResourcePool.

Anybody an idea what I'm doing wrong or is it just a bug?

Best

Noah

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

The problem is still there afaik (the changes log doesn't mention a fix for this issue).

As in the other thread, I would suggest to open a SR

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
8 Replies
LucD
Leadership
Leadership
Jump to solution

Can you share your code and any messages this returned?

A screenshot will work


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
noaboa
Contributor
Contributor
Jump to solution

Hello LucD

Thanks for your reply.

Here are two screenshots, one with VMHost and the other one with ResourcePool. I am already connected to the vCenter server. Also this codeline I just used for testing but not even this one works.

As I undestand I passed the required parameters

0 Kudos
LucD
Leadership
Leadership
Jump to solution

And which PowerCLI version are you using?

Get-Module -Name VMware.PowerCLI -ListAvailable


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
noaboa
Contributor
Contributor
Jump to solution

Your command is returning: 11.4            

And the get-powercliversion: 11.3                                                                                                                               

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Ok, you are probably referring to Re: New-VM in 11.2 requires a portgroup

Did you also try with passing a Portgroup object instead of a Portgroup name (string)?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
noaboa
Contributor
Contributor
Jump to solution

Yes excatly this post.

Like in the screenshot?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

The problem is still there afaik (the changes log doesn't mention a fix for this issue).

As in the other thread, I would suggest to open a SR

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
noaboa
Contributor
Contributor
Jump to solution

Okay, but the behaviour is strange, that it works on an older and a newer vCenter.

I guess I'll have to open an SR.

Thank you very much.

0 Kudos