Re: Re: Re: Re: RE: RE: knife winrm roles


#1

If I run the following search, I get the expected servers returned:
knife search node role:GIS
solr.log:
Apr 2, 2012 8:57:12 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/select params={sort=&indent=off&start=0&q=content:role__%3D__GIS&wt=json&fq=%2BX_CHEF_type_CHEF_X:node+%2BX_CHEF_database_CHEF_X:chef&rows=1000} hits=3 status=0 QTime=3

If I run the following winrm search, I do not get the expected server returned:
knife winrm role:GIS ipconfig -x [localadmin] -P [password] -V -V
solr.log:
Apr 2, 2012 8:59:09 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/select params={sort=X_CHEF_id_CHEF_X+asc&indent=off&start=0&q=content:role__%3D__GIS&wt=json&fq=%2BX_CHEF_type_CHEF_X:node+%2BX_CHEF_database_CHEF_X:chef&rows=1000} hits=3 status=0 QTime=2

They both get three hits but winrm returns saying no nodes returned from search. Why doesn’t winrm think there are nodes when chef-expander is returning three hits?

The only difference in the solr.log is that when done through winrm sort has a value and doesn’t in the search. I have changed the solrconfig.xml in /var/lib/chef/solr/conf/solrconfig.xml and /etc/solr/conf/solrconfig.xml just for good measure and I restarted chef-solr and chef-expander and did a knife index rebuild, but still it didn’t work. I was not able to figure out how to grep for the data of chef-expander. Can someone tell me what file I would grep through for the chef-expander data as the defect CHEF-2346 says?

Thanks,
Will

I believe that the chef-expander log is actually in the solr.log file since everytime I do a search with winrm it shows up in that log. Tailing it I saw that when I run the command with role:GIS I get 3 hits which is the expected result but the result returned to me is no nodes returned from search.

Mar 30, 2012 3:13:39 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/select params={sort=X_CHEF_id_CHEF_X+asc&indent=off&start=0&q=content:role__%3D__GIS&wt=json&fq=%2BX_CHEF_type_CHEF_X:node+%2BX_CHEF_database_CHEF_X:chef&rows=1000} hits=3 status=0 QTime=2


Thank you for the help. I am new to this and can’t really tell what is going on. My maxFieldLength in /var/lib/chef/solr/conf/solrconfig.xml is 100,000,000 so I am probably not hitting that defect. Just to make sure I rebuilt the index and still was not able to find the servers with winrm.


Checkout
http://tickets.opscode.com/browse/CHEF-2346

Very likely that some information from your windows servers is not being indexed due to this bug.

On Mar 30, 2012, at 8:54 AM, “Soula, William” <wsoula@mobicorp.commailto:wsoula@mobicorp.com> wrote:

I have figured out a way to get some kinda search results back from winrm. If I enter r*:dev* then it returns me some servers and says failed to authenticate to [“r*:dev*”] but if I enter role:dev* then nothing is returned. What is r* expanding to if it isn’t role? How can I better debug this problem? I am already using -V -V to get the most verbose logging.

Title: Re: knife winrm roles
Yeah I noticed that -m was prob not what I wanted but without the -m it says no node returned from search. Also I apologize if several copies of this problem have been emailed to the mailing list, my company hasn’t been recieving outbound emails today/last afternoon.


Title: knife winrm roles
-m says that the query is a manual list not a query…

So in your example below is trying to connect to a server named role:mobi.GIS

If you want it to execute a query for the servers to run against, simply leave out the -m…

I will update the WIKI

P
On Thu, 2012-03-29 at 13:38 -0700, Soula, William wrote:
This page:
http://wiki.opscode.com/display/chef/Knife+Windows+Bootstrap

Says this:
The winrm subcommand allows you to invoke commands in parallel on a subset of the nodes in your infrastructure. The winrm subcommand uses the same syntax as the search subcommandhttp://wiki.opscode.com/display/chef/Search; you could could find the uptime of all your web servers using the command:

% knife winrm “role:web” “net stats srv” -m -x Administrator -P ‘super_secret_password’

But when I run this in dos:
C:\SVN\Core\tool-chef-repo>knife winrm “role:mobi.GIS” “ipconfig” -m -x [localadmin] -P [password]

I get this error:
ERROR: URI::InvalidURIError: the scheme http does not accept registry part: role:mobi.GIS:5985 (or bad hostname?)

But this command works:
C:\SVN\Core\tool-chef-repo>knife search node role:mobi.GIS

Any ideas why the winrm command for me is not searching like the search command?

Will


#2

Hi,

They both get three hits but winrm returns saying no nodes returned from

search. Why doesn’t winrm think there are nodes when chef-expander is
returning three hits?

Can you confirm that these nodes have the fqdn attribute set (using knife
node show)?

Cheers,

Steve