1

I'm new to Chef and I think I'm missing something in reading the docs. I want to create servers using

knife server create (options)

but can't seem to find fully complete documentation on the options. Specifically, how do I find a mapping of server flavors to whatever knife is looking for?

Given the official wiki entry for "Launch Cloud Instances with Knife," the following is an example server creation on Rackspace:

knife rackspace server create 'role[webserver]' --server-name server01 --image 49 --flavor 2

Likewise, on the Knife Man Page, there are commands for EC2 server images (using --d --distro DISTRO) and for Slicehost servers (using -f --flavor FLAVOR)

However, what none of the documentation I've found describes is how to translate what I want to build on Rackspace ("I want Ubuntu 10.04 LTS") to what the integer entry that knife is seeking.

It strikes me that, given the lack of a description in the documentation for how to find the flavor, this should be obvious. Thus, I think I'm missing something.

1
  • Just saw this link: yviktorov.github.com/chef/2010/07/09/… which says that "image 49" is Ubuntu 10.04 and "flavor 2" is "a server size, i.e. 512MB RAM with 20GB disk for $0.03 per hour." This means simultaneously that I was confused about what flavor meant- and still missing the mapping.
    – TerraMetta
    Jan 24, 2011 at 19:00

4 Answers 4

1

There is a relatively quick and dirty way to find the image and flavor numeric ids (if you're using a browser which has an html inspection facility). Log in to rackspace cloud - and enter the form to manually create a server (you can cancel before you create one) and select the server base os (image) you want, then up pops a little overlay form with ajax. If you inspect that in your browser, it handily has the imageId as a hidden field for the image you selected, and has a radio button named "cloudServerProductFlavorId" for each available flavor.

(NB: you need to inspect the html, you can't just view the source, as this is generated dynamically and isn't in the original source)

Side note: It may help to clarify that Knife (which is part of Chef) is using the fog ruby library (https://github.com/geemus/fog) to communicate with cloud services providers to create servers. Fog is then communicating with Rackspace Cloud (or whatever) using their published api. So knife/chef can't really know what the various options are for flavor and image are.

There is documentation for the Rackspace Cloud api (available when you log in, under Support|Developer Resources). But it doesn't give a listing of available flavors and images. It instead gives an api call you can make to get those.

So you could try using the api call directly, or better, use fog to find out the flavors and images.However I didn't find a quick way to do that.

NB: A future version of knife will support using strings for rackspace flavors and images. And will be able also list them:

  knife rackspace server list flavors
  knife rackspace server list images

Read more about this: http://tickets.opscode.com/browse/CHEF-1558

1

Here is the list of flavors:

1    256 server 
2    512 server 
3    1GB server 
4    2GB server 
5    4GB server 
6    8GB server 
7    15.5GB server

And here is the list of images:

4        Debian 5.0 (lenny)
10      Ubuntu 8.04.2 LTS (hardy)
14      Red Hat Enterprise Linux 5.4
19      Gentoo 10.1
23      Windows Server 2003 R2 SP2 x64
24      Windows Server 2008 SP2 x64
28      Windows Server 2008 R2 x64
29      Windows Server 2003 R2 SP2 x86
31      Windows Server 2008 SP2 x86
40      Oracle EL Server Release 5 Update 4
41      Oracle EL JeOS Release 5 Update 3
49      Ubuntu 10.04 LTS (lucid)
51      CentOS 5.5
53      Fedora 13
55      Arch 2010.05
56      Windows Server 2008 SP2 x86 - MSSQL2K8R2
57      Windows Server 2008 SP2 x64 - MSSQL2K8R2
58      Windows Server 2008 R2 x64 - MSSQL2K8R2
62      Red Hat Enterprise Linux 5.5
69      Ubuntu 10.10 (maverick)
71      Fedora 14
14362    Ubuntu 9.10 (karmic)
187811  CentOS 5.4
0

If you have an existing server, you can use 'knife bootstrap' to set up chef on the server.

Knife doesn't know about existing rackspace images available to launch cloud instances (nor EC2 AMIs). That's something you'll need to get from Rackspace.

0

Looks like these just came out recently:

    knife rackspace image list
    knife rackspace flavor list

Have not verified the ec2 variants, but the rackspace ones work for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .