Blog-S_Generic_-1

Pre-release Announcement : Native 64-bit Windows Chef Client

Note: there is an update to this post here.

Ohai Chefs!

I’m happy to share some exciting news for our Windows users – we now have a native
64-bit Chef Client available for you to download and try out here.

This version of Chef Client includes a 64-bit version of Ruby, and addresses one of the
key pain points that Windows users can encounter when running a 32-bit process on a
64-bit version of Windows : namely, having to deal with the file and registry redirection
that Windows does under the covers, that can sometimes cause unexpected results or script failures.

(See this link
for more information on Windows redirection behavior).

To illustrate the pitfalls with redirection in a bit more detail, let’s look at an example of a
simple Chef recipe that creates a file in a directory under the Windows System32 folder. The code below
uses an environment variable to construct the path of the folder (test_dir) to write to. Then it
uses Chef’s built-in directory and file resources to define the desired state.

[code]
process_type = ENV[‘PROCESSOR_ARCHITECTURE’] == ‘AMD64′ ? ’64-bit’ : ’32-bit’
system32_dir = ::File.join(ENV[‘SYSTEMROOT’], ‘system32’)
test_dir = ::File.join(system32_dir, ‘cheftest’)
test_file = ::File.join(test_dir, ‘chef_architecture_file.txt’)

directory test_dir do
action :create
end

file test_file do
content "Chef made me, I come from a #{process_type} process."
end
[/code]

If the code above runs in a 32-bit process on a 64-bit platform, Windows redirection will kick in, and
the file and directory will actually get created in the SysWOW64 folder instead, which
is not the desired outcome. However, when this recipe is run with a native 64-bit client,
redirection will not come into play, and things will work as expected.

One other advantage of having the 64-bit package is that now we can also mark the MSI as 64-bit.
This adds more control and granularity with Windows technologies like Group Policy, WMI, etc that
can check the MSI flag and take advantage of it as needed.

Finally, the installer has also been re-architected for performance, with a noticeably faster
install experience.

Note that this is pre-release software, and while we are excited to get this out early to share with you, there are a couple of things to call out:

  • The MSI size is larger than the production chef-client – it weighs in at around 170MB. This is something we are working on and expect to resolve before a final release.
  • This is not intended for production deployment – please only use in a non-mission-critical environment.
  • Please report any issues to us on github

Thanks, and enjoy!

Salim Alam

Salim Alam is a Principal Software Engineer at Chef, and a technical lead on the Habitat team. His areas of focus include Habitat Builder, on-premises deployment, OAuth and identity, as well as cross-platform support for features such as certificate management. He has also worked across Chef on products such as Chef Client, Chef DK, and Chef Automate.