Creating and configuring a virtual machine in Amazon EC2
Before creating and configuring a virtual machine in Amazon EC2, let's verify the existing nodes converged by Chef. Local virtual machines are only configured using Chef:
[root@devops1 Desktop]# knife node list tomcatserver
After installing knife EC2 plugin, we can use
knife ec2 server create
command with following parameters to create new virtual machine:Parameter
Value
Description
-I
ami-1ecae776
ID of the Amazon machine image
-f
t2.micro
Type of virtual machine
-N
DevOpsVMonAWS
Name of the Chef node
--aws-access-key-id
Your access key ID
AWS account access key ID
--aws-secret-access-key
Your secret access key
AWS account secret access key
-S
Book
SSH key
--identity-file
book.pem
PEM file
--ssh-user
ec2-user
User for AWS instance
-r
role[v-tomcat]
Chef role
[root@devops1 Desktop]# knife ec2 server create -I ami-1ecae776 -f t2.micro -N DevOpsVMonAWS --aws-access-key...