VM: Hey VM, can I share a host with you? Affinity rules in a virtual - - PowerPoint PPT Presentation

vm hey vm can i share a host with you affinity rules in a
SMART_READER_LITE
LIVE PREVIEW

VM: Hey VM, can I share a host with you? Affinity rules in a virtual - - PowerPoint PPT Presentation

VM: Hey VM, can I share a host with you? Affinity rules in a virtual cluster 4 th of Feb 2017 Martin Sivk Senior Software Engineer Red Hat Czech 1 FOSDEM, February 2017 About me and oVirt Martin Sivk Working for Red Hat


slide-1
SLIDE 1

FOSDEM, February 2017

VM: Hey VM, can I share a host with you?

Affinity rules in a virtual cluster

4th of Feb 2017 Martin Sivák Senior Software Engineer Red Hat Czech

1

slide-2
SLIDE 2

FOSDEM, February 2017

About me and oVirt

Martin Sivák Working for Red Hat since 2007

  • Virt SLA team

2

  • oVirt | Red Hat Virtualization (since 2008)
  • Virtual datacenter management solution
  • Our virtual machines are pets, not cattle.
slide-3
SLIDE 3

FOSDEM, February 2017

Agenda

  • What is affinity
  • Why affinity - use cases
  • Overview of affinity types
  • Affinity conflicts
  • Affinity management in oVirt
  • Future ideas

3

slide-4
SLIDE 4

FOSDEM, February 2017

  • Attraction factor between

virtual machines

  • Attraction factor between virtual machines and hosts
  • Automatically enforced logical rules for virtual machine

placement ○ Less strict than pinning ○ Can dynamically adapt to the current cluster situation and load

What is affinity

4

slide-5
SLIDE 5

FOSDEM, February 2017

Why affinity?

  • Licensing requirements
  • Security
  • Better performance
  • High availability
  • Planning
  • Customer locality

5

?

slide-6
SLIDE 6

FOSDEM, February 2017

Why affinity? - licensing reasons

  • Node-based licensing

○ Software that can run only on certain amount of nodes / CPUs according to some kind of license agreement

6

+$$$

slide-7
SLIDE 7

FOSDEM, February 2017

Why affinity? - high availability

  • VMs that provide failover to each other should not run
  • n the same host to avoid compromising high availability

7

slide-8
SLIDE 8

FOSDEM, February 2017

Why affinity? - security reasons

  • Data protection enforcement

○ There are ways to access other VMs' data (e.g.: cache-based timing attacks) ○ Sensitive VMs have to be placed so they only have good neighbours

8

slide-9
SLIDE 9

FOSDEM, February 2017

  • Storage locality
  • Network overhead, microservices, databases

Why affinity? - performance aspects - VM

9

slide-10
SLIDE 10

FOSDEM, February 2017

  • Client locality

○ continent locality (with failover) - details later

  • Host hardware considerations

○ not all hosts need to be equal ○ better outside connectivity ○ prefer faster CPUs, better NICs, or storage cards

  • Dynamic subclusters

○ accounting between teams ○ zero downtime during resize, spare capacity utilization

Why affinity? - performance aspects - hosts

10

slide-11
SLIDE 11

FOSDEM, February 2017

Why affinity – hardware pass-through

  • VMs can use some devices directly

○ But need to handle cases where they are not available ○ Migration of VMs with pass-through devices is needed

11

  • ฀฀

?

slide-12
SLIDE 12

FOSDEM, February 2017

Why affinity – operations and planning

  • Gradually migrate VMs off a host to lower the number
  • f migrations when going into maintenance

○ Balancing will gradually move VMs away ○ No new VMs will be started on the host unless necessary

  • Keep certain services close together (in the same rack or

location)

○ But handle maintenance or failures

12

slide-13
SLIDE 13

FOSDEM, February 2017

Customer or management locality

  • The goal is to keep services together and close

to users to improve performance

13

slide-14
SLIDE 14

FOSDEM, February 2017

Customer or management locality - failure

  • Failure of the preferred location does not prevent access to

the service, but may hinder performance

14

slide-15
SLIDE 15

FOSDEM, February 2017

Customer or management locality - recovery

  • Once the preferred location is restored, service VMs are

gradually migrated back to improve performance

○ Live migration = no downtime

15

slide-16
SLIDE 16

FOSDEM, February 2017

Affinity types summary

  • Hard (strong)

○ Does not allow violation

  • Soft (weak)

○ Best effort, might still allow violations ○ Depends on scheduling policy factors

  • Positive
  • Negative
  • VM to VM
  • VM to Host

16

slide-17
SLIDE 17

FOSDEM, February 2017

(Solving) affinity conflicts and violations

  • During affinity rule creation

○ A B C A ○ H1 A B H2

  • During runtime

○ New rules can create violations ○ Might conflict with balancing ○ Affinity rule enforcement manager ○ Tries to resolve both hard and soft rule violations

17

slide-18
SLIDE 18

FOSDEM, February 2017

  • Affinity labels

○ simple ○ VM to host only ○ strong positive affinity

  • Affinity groups

○ advanced ○ all types

  • Conflicts

Affinity management in oVirt

18

slide-19
SLIDE 19

FOSDEM, February 2017

Affinity labels

Only hosts with all labels can run a VM.

19

DB Finance Strong Finance DB Finance ✗DB missing ✓OK Weak

slide-20
SLIDE 20

FOSDEM, February 2017

Affinity groups

  • Define a group of VMs and their relationship

“No relationship” is important for pure VM to host groups

  • Define a group of hosts and their relationship to VMs
  • 20
slide-21
SLIDE 21

FOSDEM, February 2017

  • Affinity Groups

○ VM – VM, all types – since 3.5 (1)(2) ○ VM – Host, all types – since 4.1 (2)

  • Affinity Labels

○ VM – Host, strong positive – since 4.0 (2) ○ https://www.ovirt.org/blog/2016/07/affinity-labels/

1. Configurable via the user interface 2. Configurable via the API and SDKs

Current oVirt support for affinity

21

slide-22
SLIDE 22

FOSDEM, February 2017

Future ideas

  • Allow using Affinity labels in Affinity Groups

○ To specify VMs and hosts ○ Simplified management ○ No need to edit all groups separately

the updated label will immediately propagate to all rules and relationships

  • Inversion of a rule

○ Match all VMs except A, B, and C ○ Useful for the maintenance planning case

22

slide-23
SLIDE 23

FOSDEM, February 2017

Summary

  • Affinity allows you to define (complex) relationship rules

between VMs and/or between VMs and hosts

  • Affinity is enforced dynamically and takes the current

cluster situation into account

23

slide-24
SLIDE 24

FOSDEM, February 2017

THANK YOU !

http://wiki.ovirt.org/wiki/Category:SLA users@ovirt.org devel@ovirt.org #ovirt irc.oftc.net

24