Skip to content

Homework 2. DevStack Manipulation Through CLI

life1347 edited this page Nov 5, 2013 · 20 revisions

Nova

create instance through CLI

#creds
#Paste the following:
export OS_TENANT_NAME=xxx
export OS_USERNAME=xxx
export OS_PASSWORD=xxx
export OS_AUTH_URL="http://10.211.55.38:5000/v2.0/"

load creds

$ source creds

create instance

$ nova --os-cache boot --image 91547919-76f5-4fa8-b447-67e940b28aae --flavor 1 my_first_vm

nova-create-instance nova-launch-instance

$ nova pause 83dfe637-943c-45aa-956d-2481e53139d0

nova-launch-instance

Neutron

create network

$ neutron net-create --tenant-id 873298b5fbff44b4b13a41270296af0f demo

neutron-create-network

create subnet

$ neutron subnet-create --tenant-id 873298b5fbff44b4b13a41270296af0f demo 10.50.1.0/24 --dns_nameservers list=true 8.8.8.7 8.8.8.8

neutron-create-subnet

create router

$ neutron router-create --tenant-id 873298b5fbff44b4b13a41270296af0f R_test

neutron-create-router

get l3 agent id

must ensure that user in creds has admin permission, otherwise neutron will show nothing

$ neutron agent-list

neutron-agent-list

add router to l3 agent

$ neutron l3-agent-router-add 91c26035-5d98-4cf9-b4e3-4d1d61f7c7a2 R_test

add router to the subnet

$ neutron router-interface-add 674d9ed8-99be-47d6-8793-a857a564838c 79b488aa-2f5c-4542-8aae-f9ce145a02f5

add subnet to external network

$ neutron router-gateway-set 674d9ed8-99be-47d6-8793-a857a564838c 0ad3b25a-86a9-4710-af52-ee1269f7a6e0

neutron-sub-to-ext