[chef] Re: Re: unable to run a powershell to create a failover cluster using chef.


Chronological Thread 
  • From: "Steven Murawski" < >
  • To: "" < >, "Pradeep Kumar" < >
  • Subject: [chef] Re: Re: unable to run a powershell to create a failover cluster using chef.
  • Date: Mon, 27 Apr 2015 10:22:35 -0500

Pradeep, 

Another challenge with the clustering commands is that permissions to create AD objects is required.  When you create a new cluster, the command tries to create a new computer object in active directory for that cluster name.  If the account exists and is disabled, the command will try to activate it.  If the account exists and is active, the command will fail.

Things to check - does the account that is running the chef-client have rights to create objects in AD?  Does the clustername already exist as a computer object in AD?  If it already exists, is it disabled?

A note on the flags.. pretty much everything you specified are the defaults (other than execution policy) and for the command you've specified the default of RemoteSigned should be fine.  You can probably drop that attribute (to minimize your testing surface).

Steve

Steven Murawski
Community Software Development Engineer @ Chef
Microsoft MVP - PowerShell
http://stevenmurawski.com

On 4/27/2015 9:13:22 AM, Kenneth Barry < > wrote:

This may be a case of scope.
Someone else can get more technical, but my experience has been that when a powershell script is part of a chef recipe, it doesn't always go that if it does not go as intended, that chef will know. 

To some degree, Chef only knows to run the script, not what the script will do. So, its like handing a note to a man at a door with instruction to ..... Yell for [someone] to come to the door. "Chef" takes the note, Yells into the other room for [someone] to come to the door, then turns back to you and says "OK, I did it", irregardless of someone coming to the door or not, irregardless of there even being anyone in the room or not, "You asked it to yell for someone to come to the door", and it did that.

You may want to put some debugging in place, or look into some of the features for powershell logging. I suspect you may have a syntax problem "needing to escape a character, so its being passed in incorrectly, etc.), but your not seeing the error.

On Mon, Apr 27, 2015 at 5:49 AM, Pradeep Kumar < " target="_blank"> > wrote:
Hi Every one,

hope someone could help me on this.

im trying to create a failover windows cluster using chef. im running the following

powershell_script "Validate and Create cluster" do
  code <<-EOH
 import-module failoverclusters
 New-Cluster –Name TestCluster –Node node1,node2  –StaticAddress "IP"
  EOH
  flags '-NoLogo, -NonInteractive, -NoProfile, -ExecutionPolicy Unrestricted, -InputFormat None'
end

the new-cluster command does not seem to run.

my chef run ends with a success! with no errors.

i have previously run various powershell scripts through chef and have been successfull. but no luck with this one. 


--
pradeep



--

Kenneth Barry 

TuneIn | Build and Release Engineer
M: 409-673-0544



Archive powered by MHonArc 2.6.16.

§