1)
Create Keypair
----------------
#nova keypair-add heat_key > heat_key.priv
#chmod 600 heat_key.priv
2)
Open
vim /home/saju/openstack/heat_templates/heat-templates/cfn/F17/getting_started.template
https://github.com/openstack/heat-templates/blob/master/cfn/F17/getting_started.template
* Then Change "InstanceType": "m1.small" to "InstanceType": "m1.micro", if you get the error No valid host was found (NoValidHost).
* Change ImageId "F17-x86_64-cfntools" to "fedora-20.x86_64"
Example:
-------------
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type" : "String"
}
},
"Resources" : {
"MyInstance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"KeyName" : { "Ref" : "KeyName" },
"ImageId" : "fedora-20.x86_64",
"InstanceType": "m1.micro",
"UserData" : { "Fn::Base64" : "80" }
}
}
},
"Outputs" : {
"InstanceIp" : {
"Value" : { "Fn::Join" : ["", ["ssh ec2-user@",
{"Fn::GetAtt": ["MyInstance",
"PublicIp"]}]]},
"Description" : "My ssh command"
}
}
}
3)
Create Stack
#heat stack-create teststack7 -f /home/saju/openstack/heat_templates/heat-templates/cfn/F17/getting_started.template -P "KeyName=heat_key"
4)
List Stack
#heat stack-list
5)
Find resources of stack
#heat resource-list id_of_stack
6)
Delete Stack
#heat stack-delete id_of_stack
7)
localrc
------------
saju@ubuntu:~/openstack$ cat devstack/localrc
DATABASE_PASSWORD=nova
RABBIT_PASSWORD=nova
SERVICE_TOKEN=nova
SERVICE_PASSWORD=nova
ADMIN_PASSWORD=nova
OFFLINE=True
###To capture the screen output of OpenStack services in separate log files
SCREEN_LOGDIR=/home/saju/openstack/screen_dir
###To capture the screen output of OpenStack services in one log file
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
###Ceilometer
#enable_service ceilometer-acentral,ceilometer-collector,ceilometer-api,ceilometer-acompute,ceilometer-alarm-singleton,ceilometer-alarm-notifier
#EXTRA_OPTS=(notification_driver=nova.openstack.common.notifier.rabbit_notifier,ceilometer.compute.nova_notifier scheduler_default_filters=AllHostsFilter)
#http://docs.openstack.org/developer/heat/getting_started/on_devstack.html#configure-devstack-to-enable-ceilometer-if-using-alarms
CEILOMETER_BACKEND=mongo
enable_service ceilometer-acompute ceilometer-acentral ceilometer-collector ceilometer-api
enable_service ceilometer-alarm-notifier ceilometer-alarm-evaluator
###Heat
enable_service heat,h-api,h-api-cfn,h-api-cw,h-eng
#IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-i386-cfntools.qcow2,http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-x86_64-cfntools.qcow2"
IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F19-x86_64-cfntools.qcow2"
IMAGE_URLS+=",http://mirror.chpc.utah.edu/pub/fedora/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2"
###64bit image (~660MB)
IMAGE_URLS+=",http://download.fedoraproject.org/pub/fedora/linux/updates/20/Images/x86_64/Fedora-x86_64-20-20140407-sda.qcow2"
###32bit image (~640MB)
IMAGE_URLS+=",http://download.fedoraproject.org/pub/fedora/linux/updates/20/Images/i386/Fedora-i386-20-20140407-sda.qcow2"
###Heat, Havana, Working image for the template heat-templates/cfn/F17/getting_started.template
IMAGE_URLS+=",http://cloud.fedoraproject.org/fedora-20.x86_64.qcow2"
##ssh -i heat_key.priv ec2-user@10.0.0.2
###Network configuration.
#HOST_IP should be the same as the IP you used for the private network.
# The combination of FLAT_INTERFACE and PUBLIC_INTERFACE indicates that OpenStack should
# bridge network traffic over eth1.
HOST_IP=192.168.56.101
HOST_IP_IFACE=eth1
FLAT_INTERFACE=br100
PUBLIC_INTERFACE=eth1
FLOATING_RANGE=192.168.56.224/27
Create Keypair
----------------
#nova keypair-add heat_key > heat_key.priv
#chmod 600 heat_key.priv
2)
Open
vim /home/saju/openstack/heat_templates/heat-templates/cfn/F17/getting_started.template
https://github.com/openstack/heat-templates/blob/master/cfn/F17/getting_started.template
* Then Change "InstanceType": "m1.small" to "InstanceType": "m1.micro", if you get the error No valid host was found (NoValidHost).
* Change ImageId "F17-x86_64-cfntools" to "fedora-20.x86_64"
Example:
-------------
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type" : "String"
}
},
"Resources" : {
"MyInstance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"KeyName" : { "Ref" : "KeyName" },
"ImageId" : "fedora-20.x86_64",
"InstanceType": "m1.micro",
"UserData" : { "Fn::Base64" : "80" }
}
}
},
"Outputs" : {
"InstanceIp" : {
"Value" : { "Fn::Join" : ["", ["ssh ec2-user@",
{"Fn::GetAtt": ["MyInstance",
"PublicIp"]}]]},
"Description" : "My ssh command"
}
}
}
3)
Create Stack
#heat stack-create teststack7 -f /home/saju/openstack/heat_templates/heat-templates/cfn/F17/getting_started.template -P "KeyName=heat_key"
4)
List Stack
#heat stack-list
5)
Find resources of stack
#heat resource-list id_of_stack
6)
Delete Stack
#heat stack-delete id_of_stack
7)
localrc
------------
saju@ubuntu:~/openstack$ cat devstack/localrc
DATABASE_PASSWORD=nova
RABBIT_PASSWORD=nova
SERVICE_TOKEN=nova
SERVICE_PASSWORD=nova
ADMIN_PASSWORD=nova
OFFLINE=True
###To capture the screen output of OpenStack services in separate log files
SCREEN_LOGDIR=/home/saju/openstack/screen_dir
###To capture the screen output of OpenStack services in one log file
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
###Ceilometer
#enable_service ceilometer-acentral,ceilometer-collector,ceilometer-api,ceilometer-acompute,ceilometer-alarm-singleton,ceilometer-alarm-notifier
#EXTRA_OPTS=(notification_driver=nova.openstack.common.notifier.rabbit_notifier,ceilometer.compute.nova_notifier scheduler_default_filters=AllHostsFilter)
#http://docs.openstack.org/developer/heat/getting_started/on_devstack.html#configure-devstack-to-enable-ceilometer-if-using-alarms
CEILOMETER_BACKEND=mongo
enable_service ceilometer-acompute ceilometer-acentral ceilometer-collector ceilometer-api
enable_service ceilometer-alarm-notifier ceilometer-alarm-evaluator
###Heat
enable_service heat,h-api,h-api-cfn,h-api-cw,h-eng
#IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-i386-cfntools.qcow2,http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-x86_64-cfntools.qcow2"
IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F19-x86_64-cfntools.qcow2"
IMAGE_URLS+=",http://mirror.chpc.utah.edu/pub/fedora/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2"
###64bit image (~660MB)
IMAGE_URLS+=",http://download.fedoraproject.org/pub/fedora/linux/updates/20/Images/x86_64/Fedora-x86_64-20-20140407-sda.qcow2"
###32bit image (~640MB)
IMAGE_URLS+=",http://download.fedoraproject.org/pub/fedora/linux/updates/20/Images/i386/Fedora-i386-20-20140407-sda.qcow2"
###Heat, Havana, Working image for the template heat-templates/cfn/F17/getting_started.template
IMAGE_URLS+=",http://cloud.fedoraproject.org/fedora-20.x86_64.qcow2"
##ssh -i heat_key.priv ec2-user@10.0.0.2
###Network configuration.
#HOST_IP should be the same as the IP you used for the private network.
# The combination of FLAT_INTERFACE and PUBLIC_INTERFACE indicates that OpenStack should
# bridge network traffic over eth1.
HOST_IP=192.168.56.101
HOST_IP_IFACE=eth1
FLAT_INTERFACE=br100
PUBLIC_INTERFACE=eth1
FLOATING_RANGE=192.168.56.224/27
No comments:
Post a Comment