ec2 server create syntax (man page)

This is the knife create syntax page. I was trying to launch an instance of Chef with the “knife create” command that chef’s knife provides. The documentation page gives this example for how to launch a web server on Amazon’s EC2 server, but without much explanation of the terms:

knife ec2 server create -r "role[webserver]" -I ami-2d4aa444 --flavor m1.small -G www,default -x ubuntu -N server01

After doing some searching I just ended up digging into the code and found this information quite helpful, and so I am sharing it:

-f FLAVOR ( or --flavor FLAVOR )
The flavor of server (m1.small, m1.medium, etc)
default: m1.small

-I IMAGE ( or --image IMAGE )
The AMI for the server

-G X,Y,Z ( or --groups X,Y,Z )
The security groups for this server
default: "default"

-Z ZONE ( or --availability-zone ZONE )
The Availability Zone
default: us-east-1b

-N NAME ( or --node-name NAME )
The Chef node name for your new node

-S KEY ( or --ssh-key KEY )
The AWS SSH key id

-x USERNAME ( or --ssh-user USERNAME )
The ssh username
default: root

-P PASSWORD ( or --ssh-password PASSWORD )
The ssh password

-i IDENTITY_FILE ( or --identity-file IDENTITY_FILE )
The SSH identity file used for authentication

--prerelease
Install the pre-release chef gems

--bootstrap-version VERSION
The version of Chef to install

-d DISTRO ( or --distro DISTRO )
Bootstrap a distro using a template
default: ubuntu10.04-gems

--template-file TEMPLATE
Full path to location of template to use

--ebs-size SIZE
The size of the EBS volume in GB, for EBS-backed instances

--ebs-no-delete-on-term
Do not delete EBS volume on instance termination

-r RUN_LIST ( or --run-list RUN_LIST )
Comma separated list of roles/recipes to apply

-s SUBNET-ID ( or --subnet SUBNET-ID )
create node in this Virtual Private Cloud Subnet ID (implies VPC mode)

--no-host-key-verify
Disable host key verification

--user-data USER_DATA_FILE (or -u USER_DATA_FILE )
The EC2 User Data file to provision the instance with

There is also the knife --help command:

Usage:

knife sub-command (options)

flags

-s, --server-url URL Chef Server URL
-k, --key KEY API Client Key
--color Use colored output
-c, --config CONFIG The configuration file to use
--defaults Accept default values for all questions
-e, --editor EDITOR Set the editor to use for interactive commands
-E, --environment ENVIRONMENT Set the Chef environment
-F, --format FORMAT Which format to use for output
--no-color Don\'t use colors in the output
-n, --no-editor Do not open EDITOR, just accept the data as is
-u, --user USER API Client Username
--print-after Show the data after a destructive operation
-V, --verbose More verbose output. Use twice for max verbosity
-v, --version Show chef version
-y, --yes Say yes to all prompts for confirmation
-h, --help Show this message

Available subcommands: (for details, knife SUB-COMMAND –help)

** BOOTSTRAP COMMANDS **

knife bootstrap FQDN (options)

** CLIENT COMMANDS **

knife client list (options)
knife client reregister CLIENT (options)
knife client edit CLIENT (options)
knife client bulk delete REGEX (options)
knife client create CLIENT (options)
knife client show CLIENT (options)
knife client delete CLIENT (options)

** CONFIGURE COMMANDS **

knife configure client DIRECTORY
knife configure (options)

** COOKBOOK COMMANDS **

knife cookbook test [COOKBOOKS...] (options)
knife cookbook create COOKBOOK (options)
knife cookbook download COOKBOOK [VERSION] (options)
knife cookbook list (options)
knife cookbook delete COOKBOOK VERSION (options)
knife cookbook metadata from FILE (options)
knife cookbook show COOKBOOK [VERSION] [PART] [FILENAME] (options)
knife cookbook bulk delete REGEX (options)
knife cookbook metadata COOKBOOK (options)
knife cookbook upload [COOKBOOKS...] (options)

** COOKBOOK SITE COMMANDS **

knife cookbook site show COOKBOOK [VERSION] (options)
knife cookbook site share COOKBOOK CATEGORY (options)
knife cookbook site search QUERY (options)
knife cookbook site download COOKBOOK [VERSION] (options)
knife cookbook site list (options)
knife cookbook site unshare COOKBOOK
knife cookbook site install COOKBOOK [VERSION] (options)

** DATA BAG COMMANDS **

knife data bag show BAG [ITEM] (options)
knife data bag edit BAG ITEM (options)
knife data bag list (options)
knife data bag from file BAG FILE (options)
knife data bag create BAG [ITEM] (options)
knife data bag delete BAG [ITEM] (options)

** EC2 COMMANDS **

knife ec2 instance data (options)
knife ec2 server list (options)
knife ec2 server create (options)
knife ec2 server delete SERVER [SERVER] (options)

** ENVIRONMENT COMMANDS **

knife environment list (options)
knife environment show ENVIRONMENT (options)
knife environment edit ENVIRONMENT (options)
knife environment create ENVIRONMENT (options)
knife environment from file FILE (options)
knife environment delete ENVIRONMENT (options)

** EXEC COMMANDS **

knife exec [SCRIPT] (options)

** HELP COMMANDS ** ]knife help [list|TOPIC]

** INDEX COMMANDS ** ]knife index rebuild (options)

** NODE COMMANDS **

knife node from file FILE (options)
knife node create NODE (options)
knife node show NODE (options)
knife node edit NODE (options)
knife node delete NODE (options)
knife node list (options)
knife node run_list remove [NODE] [ENTRY] (options)
knife node run_list add [NODE] [ENTRY] (options)
knife node bulk delete REGEX (options)

** RECIPE COMMANDS **

knife recipe list [PATTERN]

** ROLE COMMANDS **

knife role from file FILE [FILE..] (options)
knife role show ROLE (options)
knife role edit ROLE (options)
knife role list (options)
knife role delete ROLE (options)
knife role create ROLE (options)
knife role bulk delete REGEX (options)

** SEARCH COMMANDS **

knife search INDEX QUERY (options)

** SSH COMMANDS **

knife ssh QUERY COMMAND (options)

** STATUS COMMANDS **

knife status QUERY (options)

** TAG COMMANDS **

knife tag list NODE
knife tag delete NODE TAG ...
knife tag create NODE TAG ...

And also the knife create --help command:

knife ec2 server create (options)
-Z, --availability-zone ZONE The Availability Zone
-A, --aws-access-key-id KEY Your AWS Access Key ID
-K SECRET Your AWS API Secret Access Key
--aws-secret-access-key
--user-data USER_DATA_FILE The EC2 User Data file to provision the instance with
--bootstrap-version VERSION The version of Chef to install
-N, --node-name NAME The Chef node name for your new node
--server-url URL Chef Server URL
-k, --key KEY API Client Key
--color Use colored output
-c, --config CONFIG The configuration file to use
--defaults Accept default values for all questions
-d, --distro DISTRO Bootstrap a distro using a template
--ebs-no-delete-on-term Do not delete EBS volumn on instance termination
--ebs-size SIZE The size of the EBS volume in GB, for EBS-backed instances
-e, --editor EDITOR Set the editor to use for interactive commands
-E, --environment ENVIRONMENT Set the Chef environment
-f, --flavor FLAVOR The flavor of server (m1.small, m1.medium, etc)
-F, --format FORMAT Which format to use for output
-i IDENTITY_FILE The SSH identity file used for authentication
--identity-file
-I, --image IMAGE The AMI for the server
--no-color Don\'t use colors in the output
-n, --no-editor Do not open EDITOR, just accept the data as is
--no-host-key-verify Disable host key verification
-u, --user USER API Client Username
--prerelease Install the pre-release chef gems
--print-after Show the data after a destructive operation
--region REGION Your AWS region
-r, --run-list RUN_LIST Comma separated list of roles/recipes to apply
-G, --groups X,Y,Z The security groups for this server
-S, --ssh-key KEY The AWS SSH key id
-P, --ssh-password PASSWORD The ssh password
-x, --ssh-user USERNAME The ssh username
-s, --subnet SUBNET-ID create node in this Virtual Private Cloud Subnet ID (implies VPC mode)
--template-file TEMPLATE Full path to location of template to use
-V, --verbose More verbose output. Use twice for max verbosity
-v, --version Show chef version
-y, --yes Say yes to all prompts for confirmation
-h, --help Show this message

Hope these will be helpful.

These are some of the terms I was trying to use to find information about the syntax of the knife create (ec2) manual / page.

  • knife flavor group
  • knife ec2
  • knife ec2 g group
  • knife ec2 g group man
  • knife ec2 server flavor g n x
  • knife ec2 server flavor g n x
  • knife ec2 server flavor g n x man

Related Posts:

This entry was posted in Linux, Server Admin, Server Administration, Tech Tips, Web Development and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *