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

Openstack study-nova-02

Embed Size (px)

Citation preview

Nova

OpenStack Study 4th

클라우드개발팀 신진호

nova-scheduler

• FilterScheduler is a default scheduler

– Supports filtering and weighting

• 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

– 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

• Weighting

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

– Virtually consumes resources.

nova-scheduler > filter scheduler

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

Host aggregate and Availability zone

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

Hypervisor Types

• Type-1: bare metal hypervisor

• Type-2: hosted hypervisor

nova-compute > hypervisors

Hypervisors

• Hypervisor-V

– Microsoft

– Windows Server Virtualization.

– Linux available

– On x86-64

• XenServer

– Citrix

• VMWare Vcenter

– VMware

nova-compute > hypervisors

• Libvirt

– Linux API for Virtualization

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

nova-compute > hypervisors

• Libvirt

– Two means of control• Local

• Remote

nova-compute > hypervisors

local remote

• 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

How do we select a hypervisor ?

See ‘Hypervisor support matrix’

And Compare!

nova-compute > hypervisors

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

nova-compute > hypervisors

There are so many!

• 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

• 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

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

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

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.

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’

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

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

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/

EOF