Couch to OpenStack: Nova - July, 30, 2013

23
Compute - Nova Couch To OpenStack

description

Tuesday, July 30th session of the vBrownBag OpenStack Sack Lunch Series: Couch to OpenStack. We cover Nova, the Compute Service that deploys and runs VMs.

Transcript of Couch to OpenStack: Nova - July, 30, 2013

Page 1: Couch to OpenStack: Nova - July, 30, 2013

Compute - Nova

Couch To OpenStack

Page 2: Couch to OpenStack: Nova - July, 30, 2013

- git clone https://github.com/bunchc/Couch_to_OpenStack.git

- cd Couch_to_OpenStack- vagrant up

Build Time!

Page 3: Couch to OpenStack: Nova - July, 30, 2013

- Subscribe & Recordings: http://bit.ly/BrownbagPodcast

- Sign up for the rest of the series: http://openstack.prov12n.com/about-couch-to-openstack/

Some Logistics

Page 4: Couch to OpenStack: Nova - July, 30, 2013

On Twitter: #vBrownBag

Also: @VMTrooper

Join the conversation

Page 5: Couch to OpenStack: Nova - July, 30, 2013

- New Edition: http://www.packtpub.com/openstack-cloud-computing-cookbook-second-edition/book

- Old Edition: http://amzn.to/12eI6rX

Buy the Book

Page 6: Couch to OpenStack: Nova - July, 30, 2013

7/2/2013 – Intro to OpenStack7/9/2013 – Vagrant Primer7/16/2013 – Identity services (Keystone)7/23/2013 – Image services (Glance)7/30/2013 – Compute Services (Nova) << We Are Here8/6/2013 – Block Storage / Volume Services (Cinder)8/13/2013 – Networking Services (Quantum)8/20/2013 – Monitoring & Troubleshooting8/27/2013 – HA OpenStack9/3/2013 – DevOps Deployments

Note: Dates are subject to change depending on how far we get in each lesson.

The Rest of the Series

Page 7: Couch to OpenStack: Nova - July, 30, 2013

Use the automated Glance Install and manually install Nova

Remember we have a G+ Support group here:https://plus.google.com/communities/101663052588382171429

Homework Review

Page 8: Couch to OpenStack: Nova - July, 30, 2013

- Creates the Controller & Nova (Compute) Nodes- Sets variables required for Nova deployment- Creates an Nova Service and Endpoint in

Keystone- Updates MySQL

- Creates a Nova DB- Assigns the Nova User to the DB

- Installs Nova- Configures Nova settings

Build – What’s it doing?

Page 9: Couch to OpenStack: Nova - July, 30, 2013

- Deploy and run cloud computing workloads- Depending on the hypervisor, the VMs run

natively on the Nova Host (KVM, Xen) or are remotely controlled via API (vSphere)

- Nova gets its images from Glance- … Let’s take a look:

Nova Intro

Page 10: Couch to OpenStack: Nova - July, 30, 2013

- Deploy an additional node- Increase resource allocations beyond the default- … Let’s take a look:

Vagrantfile Review

Page 11: Couch to OpenStack: Nova - July, 30, 2013

Keystone Intro

Page 12: Couch to OpenStack: Nova - July, 30, 2013

- http://docs.openstack.org/trunk/openstack-compute/admin/content/installing-openstack-compute-on-debian.html

- http://docs.openstack.org/trunk/openstack-compute/install/apt/content/example-installation-architecture.html

Concepts – Reference

Page 13: Couch to OpenStack: Nova - July, 30, 2013

- vagrant ssh controller- sudo su -- cat .stackrc

- export OS_TENANT_NAME=cookbook- export OS_USERNAME=admin- export OS_PASSWORD=openstack- export

OS_AUTH_URL=http://${MY_IP}:5000/v2.0/

- source .stackrc

Using Nova!

Page 14: Couch to OpenStack: Nova - July, 30, 2013

- keystone service-list+----------------------------------+----------+----------+----------------------------+| id | name | type | description |+----------------------------------+----------+----------+----------------------------+| 3e5e37bd90394e01b981daef86c10dab | ec2 | ec2 | EC2 Service || 07409443890b4d7da1ae35686332b2c3 | glance | image | OpenStack Image Service || e8fcf639a36147de8b9894db072268b6 | keystone | identity | OpenStack Identity Service || c9c4ffc41c184c82bfa9e501a35977f7 | nova | compute | OpenStack Compute Service |+----------------------------------+----------+----------+----------------------------+

- keystone service-get <UUID>+-------------+----------------------------------+| Property | Value |+-------------+----------------------------------+| description | OpenStack Compute Service || id | c9c4ffc41c184c82bfa9e501a35977f7 || name | nova || type | compute |+-------------+----------------------------------+

Verify Nova Service

Page 15: Couch to OpenStack: Nova - July, 30, 2013

- nova-manage service list

Binary Host Zone Status Statenova-conductor controller.book internal enabled :-)nova-scheduler controller.book internal enabled :-)nova-compute compute.book nova enabled :-)nova-network compute.book internal enabled :-)

If any binaries have an XXX State, check the /var/log/nova logs on the appropriate host

Verify Nova Component Status

Page 16: Couch to OpenStack: Nova - July, 30, 2013

Nova Component Locations

Controller Compute Node

nova-api nova-compute

nova-scheduler nova-network

nova-objectstore nova-api-metadata

nova-conductor

Page 17: Couch to OpenStack: Nova - July, 30, 2013

Nova Component Functions

Component Purpose

nova-api Interact with users and other OpenStack services

nova-scheduler Determine which Nova node to deploy a VM on

nova-objectstore Simple Image storage that we replace with Glance

nova-conductor Update database on behalf of nova-compute

nova-compute Deploy and run instances

nova-api-metadata Provide information about instances

nova-network Original OpenStack networking service

Page 18: Couch to OpenStack: Nova - July, 30, 2013

- Private Network to be used by our OpenStack Compute instances internally:nova-manage network create privateNet \ --fixed_range_v4=10.10.<your third octet>.2/24 \ --network_size=20 \ --bridge_interface=eth2

- Public Network to access our OpenStack Compute instances:nova-manage floating create --ip_range=172.16.<your third octet>.2/28

- Access rules that will be implemented in the instance iptables:nova secgroup-add-rule default tcp 22 22 0.0.0.0/0nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0

- Restart Nova-Network:service nova-network restart

Configure Networking

Page 19: Couch to OpenStack: Nova - July, 30, 2013

- Create a certificate file for communication with your VMnova keypair-add demo > demo.pemchmod 0600 *.pem

- Verify your imagesnova image-list OR glance image-list+--------------------------------------+----------------------------+-------------+-----------+| ID | Name | Disk Format | Size |+--------------------------------------+----------------------------+-------------+-----------+| bc670eb3-67dc-42f3-82b2-91e96f5eca52 | Cirros 0.3 | qcow2 | 9761280 || 90c17ca9-6447-4d45-b862-86366881c13a | Ubuntu 12.04 x86_64 Server | qcow2 | 252641280 |+--------------------------------------+----------------------------+-------------+-----------+

- Boot a new instance of an imagenova boot myInstance --image <Image ID> --flavor 2 --key_name demo

Deploy an Instance

Page 20: Couch to OpenStack: Nova - July, 30, 2013

# nova-manage instance_type listm1.tiny: Memory: 512MB, VCPUS: 1, Root: 0GB, Ephemeral: 0Gb, FlavorID: 1, Swap: 0MB…m1.small: Memory: 2048MB, VCPUS: 1, Root: 20GB, Ephemeral: 0Gb, FlavorID: 2, Swap: 0MB…m1.medium: Memory: 4096MB, VCPUS: 2, Root: 40GB, Ephemeral: 0Gb, FlavorID: 3, Swap: 0MB… m1.large: Memory: 8192MB, VCPUS: 4, Root: 80GB, Ephemeral: 0Gb, FlavorID: 4, Swap: 0MB…m1.xlarge: Memory: 16384MB, VCPUS: 8, Root: 160GB, Ephemeral: 0Gb, FlavorID: 5, Swap: 0MB…

Nova Instance Flavors

Page 21: Couch to OpenStack: Nova - July, 30, 2013

On the Compute Node, review /var/log/nova/nova-compute.log

Instance Deployment Progress

Page 22: Couch to OpenStack: Nova - July, 30, 2013

For next week’s session, we will add another node to the deployment: Cinder for Block Storage.

We will need perform a few extra actions than we have done for the previous sessions:1. Edit the Vagrantfile to generate an additional server give it the name “cinder”

2. The additional server that we create should have its own shell script file with its hostname as the filename (ex: cinder.sh).

3. The controller.sh will need to be extended to create a cinder database, an endpoint, service, etc. Also, the nova.conf file will need to be extended to use Cinder for Block Storage

4. Post ideas, questions, comments on the Google Plus Community

Homework!

Page 23: Couch to OpenStack: Nova - July, 30, 2013

Now that you know a little about Nova, attempt an integration with vSphere. There are two options:1. A single Nova node can control a single ESXi node2. A single Nova node can control a single vCenter Cluster (Cluster should only have one

shared datastore)

How do I spin up a test vSphere environment as easily as I can with the OpenStack labs? The AutoLab, of course!

Reference Sites:3. Nova-vSphere Integration: https://wiki.openstack.org/wiki/NovaVMware/DeveloperGuide4. Nova-vSphere Integration:

http://docs.openstack.org/trunk/openstack-compute/admin/content/vmware.html5. AutoLab: http://www.labguides.com/autolab/

Extra Credit