Top Banner
Nova OpenStack Study 4 th 클라우드개발팀 신진호
25

Openstack study-nova-02

Jul 14, 2015

Download

Engineering

Jinho Shin
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Openstack study-nova-02

Nova

OpenStack Study 4th

클라우드개발팀 신진호

Page 2: Openstack study-nova-02

nova-scheduler

• FilterScheduler is a default scheduler

– Supports filtering and weighting

Page 3: Openstack study-nova-02

• Filtering

– RetryFilter• Prevents the scheduler from selecting the host that fails

to respond.

– AvailablilityZoneFilter• Filters hosts by availability zone.

– RamFilter• Select hosts that have sufficient RAM.

• Can overcommitment by configuration.

– ComputeFilter• Passes all hosts that are operational and enabled.

nova-scheduler > filter scheduler

Page 4: Openstack study-nova-02

– ComputeCapabilitiesFilter• Satisfy the extra specs associated with the instance type.

– ImagePropertiesFilter• Filters hosts based on properties defined on the

instance's image.

nova-scheduler > filter scheduler

Page 5: Openstack study-nova-02

• Weighting

– Each time the scheduler selects a host and subsequent selections are adjusted accordingly.

– Virtually consumes resources.

nova-scheduler > filter scheduler

Page 6: Openstack study-nova-02

Host aggregates and Availability zone

• Host aggregates– Be logically grouped.

– Node can be assigned to multiple host aggregates.

– Only visible to administrators.

– For operations.• e.g. nodes with SSD or nodes with 10G NIC

• Availability Zone– Be logically grouped.

– One availability zone.

– Visible to users.

– For HA, physical isolation, …• e.g. by using separate power supplies for HA and

network gears for load balancing

Page 7: Openstack study-nova-02

Host aggregate and Availability zone

Page 8: Openstack study-nova-02

It Supports multiple hypervisors.

Because, it Has an abstraction layer, Driver.

Components > nova-compute

nova-compute

Compute Agent(KVM)

libvirt

KVM

VM VM

nova-compute

Compute Agent(Hyper-v)

Hyper-v

VM VM

nova-compute

Abstraction layer, Driver

any hypervisor

VM VM

Page 9: Openstack study-nova-02

Hypervisor Types

• Type-1: bare metal hypervisor

• Type-2: hosted hypervisor

nova-compute > hypervisors

Page 10: Openstack study-nova-02

Hypervisors

• Hypervisor-V

– Microsoft

– Windows Server Virtualization.

– Linux available

– On x86-64

• XenServer

– Citrix

• VMWare Vcenter

– VMware

nova-compute > hypervisors

Page 11: Openstack study-nova-02

• Libvirt

– Linux API for Virtualization

– KVM, LXC(LinuX Container), QEMU, Xen, …• driver-based architecture

nova-compute > hypervisors

Page 12: Openstack study-nova-02

• Libvirt

– Two means of control• Local

• Remote

nova-compute > hypervisors

local remote

Page 13: Openstack study-nova-02

• Ironic

– OpenStack Component for managing and provisioning Bare Metal servers.

– Not VMs.

– Makes physical servers as easy to provision as VMs in cloud.

nova-compute > hypervisors

Page 14: Openstack study-nova-02

How do we select a hypervisor ?

See ‘Hypervisor support matrix’

And Compare!

nova-compute > hypervisors

http://docs.openstack.org/developer/nova/support-matrix.html

Page 15: Openstack study-nova-02

nova-compute > hypervisors

There are so many!

Page 16: Openstack study-nova-02

• More summary

– Mandatory• Get instance status

• Launch instance

• Shutdown instance

• Image storage support

– Choice• Flat networking or VLAN networking

– Provide network connectivity to guests

– Optional• Attach/Detach block volume to instance

– hotplug additional block storage to a running instance.

nova-compute > hypervisors

Page 17: Openstack study-nova-02

• Consideration about optional features

– Are your instances a pet or a cattle?

• Pet– A unique instance. It is only one.

» Attach/Detach block volume to/from instance.

» Live migrate instance across hosts.

» Suspend instance

» Swap block volumes

• Cattle– Replaceable. Remove and Re-Create.

– Enough mandatory features.

nova-compute > hypervisors

Page 18: Openstack study-nova-02

initialization of a cloud instance

• File Injection

• Metadata Service

– Instance-specific data.• Metadata, user data, ssh key

– At http://169.254.169.254.

– Supports an OpenStack metadat API and an EC2-compatible API.

# nova boot –flavor 1 –image cirros –nic net-id=d58bbcac-1908-4cda-a9da-a13cfbbf4e77 –file /fileinject=/root/keystonerc vm-file-inject

Page 19: Openstack study-nova-02

initialization of a cloud instance

• Cloud-init

– Defacto multi-distribution package

– Setting a default local

– Setting a instance hostname

– Generating instance ssh private keys

– Adding ssh keys to users, so they can log in.

– Setting up ephemeral mount point

– be configured via user-data

Page 20: Openstack study-nova-02

initialization of a cloud instance

– User-data• Arbitary data that a user can supply to a instance during

its creation time

• ‘—user-data’– The base64-encoded MIME user data for the instances.

• ‘—user-data-file’– The file name of the user data for the instances.

Page 21: Openstack study-nova-02

initialization of a cloud instance

– be configured via user-data• Format

– User-Data Script (shell script)

» ‘#!’ or ‘Content-Type: text/x-shellscript’

– Include File

» ‘#include’ or ‘Content-Type: text/x-include-url’

– Cloud Config Data (YAML)

» ‘#cloud-config’ or ‘Content-Type: text/cloud-config’

– Upstart Job

» ‘#upstart-job’ or ‘Content-Type: text/upstart-job’

– Cloud Boothook

» ‘#cloud-boothook’ or ‘Content-Type: text/cloud-boothook’

– Part Handler

» ‘#part-handler’ or ‘Content-Type: text/part-handler’

Page 22: Openstack study-nova-02

initialization of a cloud instance

#!/bin/sh echo

"Hello World. The time is now $(date -R)!" | tee /root/output.txt

$ euca-run-instances --key mykey --user-data-file myscript.sh ami-a07d95c9

#cloud-config# vim: syntax=yaml## Add yum repository configuration to the system## The following example adds the file /etc/yum.repos.d/epel_testing.repo# which can then subsequently be used by yum for later operations.yum_repos:

# The name of the repositoryepel-testing:

# Any repository configuration options# See: man yum.conf## This one is required!baseurl: http://download.fedoraproject.org/pub/epel/testing/5/$basearchenabled: falsefailovermethod: prioritygpgcheck: truegpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPELname: Extra Packages for Enterprise Linux 5 - Testing

Page 23: Openstack study-nova-02

initialization of a cloud instance

• Two ways to initialization

– Injection by hypervisor

– By Metadata Service and Cloud-init1. Boots an instance.

2. Executes Cloud-init.

3. Cloud-init gets metadata from a metadata service.

4. Bootstrap the instance with desired configurations.

# nova boot –flavor 1 –image cirros –nic net-id=d58bbcac-1908-4cda-a9da-a13cfbbf4e77 –file /fileinject=/root/keystonerc vm-file-inject

Page 24: Openstack study-nova-02

Links

• Anatomy of the libvirt virtualization library

– http://www.ibm.com/developerworks/library/l-libvirt/

• libvirt

– http://libvirt.org/index.html

• Scheduling

– http://docs.openstack.org/icehouse/config-reference/content/section_compute-scheduler.html

• Openstack Zoning – Region/Availability Zone/Host Aggregate

– https://kimizhang.wordpress.com/2013/08/26/openstack-zoning-regionavailability-zonehost-aggregate/

• Availability Zones and Host Aggregates in OpenStack Compute (Nova)

– http://blog.russellbryant.net/2013/05/21/availability-zones-and-host-aggregates-in-openstack-compute-nova/

• An Introduction to Droplet Metadata

– https://www.digitalocean.com/community/tutorials/an-introduction-to-droplet-metadata

• HOW WE USE CLOUDINIT IN OPENSTACK HEAT

– http://sdake.io/2013/03/03/how-we-use-cloudinit-in-openstack-heat/

• How to inject file/meta/ssh key/root password/userdata/config drive to a VM during nova boot

– https://kimizhang.wordpress.com/2014/03/18/how-to-inject-filemetassh-keyroot-passworduserdataconfig-drive-to-a-vm-during-nova-boot/

• Cloud-init– https://cloudinit.readthedocs.org/en/latest/

Page 25: Openstack study-nova-02

EOF