chef-provisioning icon indicating copy to clipboard operation
chef-provisioning copied to clipboard

Machine batch is always up to date

Open gdud opened this issue 9 years ago • 2 comments

I have a simple recipe that creates two machines in parallel. I'm using my own driver implementation for XenServer, but it's not important in that case, I think.

When I run chef client machine_batch is always up to date and machines are not created.

* machine_batch[default] action converge[2015-12-14T08:56:24+01:00] INFO: Processing machine_batch[default] action converge (cse_env::testenv_xen line 28)
 (up to date)

Without machine_batch, everything goes well and machines are created (synchronously, of course).

Do you have any idea what the problem might be? Probably I'm doing something wrong, but I don't know what.

Snippet of my recipe:

machine_batch do
  machine 'linux' do  
    chef_server :chef_server_url => chef_zero_server.url
    machine_options(
      xen_options: {
        template_id: '7280a723-ed10-596c-73bb-0873c3e7fe17'
      },
      convergence_options: {
        chef_version: '12.4.1'
      }
    )
    role 'linux_dev_server'
  end

  machine 'windows' do
    chef_server :chef_server_url => chef_zero_server.url
    machine_options(
      xen_options: {
        template_id: '9133ae43-a829-660f-2f1d-00135981b99d'
      },
      convergence_options: {
        chef_version: '12.4.1'
      }
    )
    role 'win_dev_server'
  end
end

gdud avatar Dec 14 '15 08:12 gdud

Same problem here!

chrodriguez avatar Apr 20 '16 19:04 chrodriguez

I had similar issues in the version of chef provisioning around early-mid december.

One thing to try though is adding an action to your machine_batch with your desired action.. i think the default action for machine_batch is :converge so it may lead to undesired results if you call it without an action - specially if your intent was to do :setup

so short story: if you call machine_batch without an action even if you specify in the machine to do an action :setup or similar.. it will still :converge them unless you set the action in machine_batch to be the action you desire...

also this may not be your issue but it's worth mentioning!

machine_batch do
  action :setup
    machine 'something' do
      ..
   end
end

nukepuppy avatar Apr 21 '16 13:04 nukepuppy