VMware Cloud Community
JimKnopf99
Commander
Commander
Jump to solution

AutoDeploy issue with new-deployrule

Hi,

i wan´t to create a new autodeploy setup in my test environment. For that, i am using the latest vsphere 6 version and the latest power cli version 6.3 release1.

Following commands where using to create a deploy rule that automatic add a host to the cluster named "cluster"

First, add the software depot

add-esxsoftwaredepot "path to zip file"

new-esximageprofile -cloneprofile ESXi-6.0.0-20160302001 -standard -name Nested

Here is where the issue pop up.

New-deployrule -name "test" -item "Nested",cluster -pattern "ipv4=192.168.1.50"

I get the following error message

powercli.PNG

If i done the same with powercli version 6.0 Release 3, the issue not occur. There is an issue with the "cluster" point in the command.

Could anybody confirm that?

Frank

If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
1 Solution

Accepted Solutions
ashukla02
Contributor
Contributor
Jump to solution

Hi Jim,

When we create a New-DeployRule, we provide the objects which hold the values for "Item" switch (or directly the name of the item literally).

That means, the below PowerCLI command should work-

example: New-DeployRule -Name <name_of_the_rule> -Item $img,$hp,$cluster -AllHosts

In the example above,

1) $img  is the variable which holds the Image Profile value. We can create this variable by-   "$img= Get-EsxImageProfile -Name <your_desired_profile_from_depot>"

2) $hp is the the variable which holds Host Profile value. We can create this variable by-   "$hp= Get-VMHostProfile -Name <your_desired_host_profile>"

3) $cluster is the variable which holds Cluster or Folder or Datacenter value. We can create this variable by-   "$cluster= Get-Cluster -Name <your_desired_cluster_or_folder_or_datacenter>"


This works well with PowerCLI 6.3 Release 1 as well.


-Avinash

View solution in original post

0 Kudos
15 Replies
LucD
Leadership
Leadership
Jump to solution

Why do you have -Item "Nested",cluster ?

Are both clusternames ?

Did you already try passing a cluster object, i.e. an object returned by Get-Cluster ?


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

0 Kudos
JimKnopf99
Commander
Commander
Jump to solution

Hi Luc,

The "Nested" is my imageprofile. I get that from the online help

To create a rule that instructs Auto Deploy to provision the set of hosts in the specified IP range with the image you selected and with the host profile you created from the reference host, type the following command and press Enter.

New-DeployRule -name "Production01Rule" -item "image_profile", ESXiGold,target_cluster -Pattern "ipv4=IP_range"

So "Nested" is my image-profile and ´"cluster" is my vmware cluster.

i receive an cluster name with get-cluster.

powercli2.JPG

The command is working if i not use the "Cluster" part

Frank

If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
JimKnopf99
Commander
Commander
Jump to solution

Also it is not possible to add any new-deployrule if you have already add one.

Here, i wan´t to create a deploy rule to added a hostprofile called TEST on allhosts

powercli3.JPG

It is possible with PowerCLI 6.0 Release3

powercli4.JPG

Frank

If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
LucD
Leadership
Leadership
Jump to solution

That looks indeed like an "issue" in 6.3.

I suggest to open a SR (PowerCLI is supported).


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

0 Kudos
JimKnopf99
Commander
Commander
Jump to solution

Hi Luc,

they don´t wan´t to open a SR for that. They told me, that my support contract did not include to open tickets like this.

Frank

If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Let me check with the powers that be.


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

0 Kudos
alanrenouf
VMware Employee
VMware Employee
Jump to solution

Jim,

Firstly I am so sorry you got that response from GSS, if the cmdlet works in one version and not the next then it is clear it is an issue with the product or the API, either way this should be supported by us and I am sorry you got that response from them, this is something I am following up with internally.

Secondly, we are looking into the issue you have here and will hopefully provide a fix in the near future.

Alan

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
0 Kudos
ashukla02
Contributor
Contributor
Jump to solution

Hi Jim,

When we create a New-DeployRule, we provide the objects which hold the values for "Item" switch (or directly the name of the item literally).

That means, the below PowerCLI command should work-

example: New-DeployRule -Name <name_of_the_rule> -Item $img,$hp,$cluster -AllHosts

In the example above,

1) $img  is the variable which holds the Image Profile value. We can create this variable by-   "$img= Get-EsxImageProfile -Name <your_desired_profile_from_depot>"

2) $hp is the the variable which holds Host Profile value. We can create this variable by-   "$hp= Get-VMHostProfile -Name <your_desired_host_profile>"

3) $cluster is the variable which holds Cluster or Folder or Datacenter value. We can create this variable by-   "$cluster= Get-Cluster -Name <your_desired_cluster_or_folder_or_datacenter>"


This works well with PowerCLI 6.3 Release 1 as well.


-Avinash

0 Kudos
ashukla02
Contributor
Contributor
Jump to solution

>>>Also it is not possible to add any new-deployrule if you have already add one. Here, i wan´t to create a deploy rule to added a hostprofile called TEST on allhosts

Here, the "TEST" should be either-- exact Image Profile Name or the Object which holds the Image Profile Name.

Example-

PowerCLI C:\> New-DeployRule -Name "esxi60u2_no_tools" -Item "ESXi-6.0.0-20160302001-no-tools" -AllHosts

Name        : esxi60u2_no_tools

PatternList :

ItemList    : {ESXi-6.0.0-20160302001-no-tools}

PowerCLI C:\>

Or,

PowerCLI C:\> $ip = Get-EsxImageProfile -Name ESXi-6.0.0-20160302001-standard

PowerCLI C:\> $ip

Name                           Vendor          Last Modified   Acceptance Level

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

ESXi-6.0.0-20160302001-stan... VMware, Inc.    3/4/2016 3:3... PartnerSupported

PowerCLI C:\>

PowerCLI C:\> New-DeployRule -Name new_test -Item $ip -AllHosts

Name        : new_test

PatternList :

ItemList    : {ESXi-6.0.0-20160302001-standard}

PowerCLI C:\>

0 Kudos
JimKnopf99
Commander
Commander
Jump to solution

Hi Avinash,

thats right. The way you do it works also for me. But i guess it also has to work if i do not use the vairables. Like it is described in the help files.

But thanks anyway for sharing!!

Frank

If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
JimKnopf99
Commander
Commander
Jump to solution

Hi Alan,

no worries. I don´t know if i am doing something wrong or if it is really a bug. That was my only question that i would like to know.

Do i something wrong with the code? Thats what i wan´t to know.

Thanks

Frank

If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
ashukla02
Contributor
Contributor
Jump to solution

Without variables too, it worked for me. Refer comment#9.

0 Kudos
rsteiner99
Contributor
Contributor
Jump to solution

I've got the same problem with PowerCLI 6.3 R1 and a rollback to 6.0 R3 solved it for the moment.

The same is true if you copy an existing rule with copy-deployrule with 6.3 R1.

I opened a SR (16952272904) with VMware.

regards,

Ronny

0 Kudos
alanrenouf
VMware Employee
VMware Employee
Jump to solution

We found a bug with the latest version and a new build has now been published, please see the release notes here for the fixed issues: http://pubs.vmware.com/Release_Notes/en/powercli/63r1/powercli63r1-releasenotes.html? and download the latest version here: https://my.vmware.com/group/vmware/get-download?downloadGroup=PCLI630R1

Please do let me know if this doesn't resolve your issue and sorry for the bug.

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
JimKnopf99
Commander
Commander
Jump to solution

Hi Alan,

thank your for you fast response!!! That release works perfect!

Thank you so much!

Frank

If you find this information useful, please award points for "correct" or "helpful".
0 Kudos