21.05.2014 / 13.40h / Classroom S07
workshop
Bare-Metal Hypervisors and High Availability Systems CIPFP AUSIÀS MARCH
J o s é
R a m ó n
R u i z
CENTRE INTEGRAT PÚBLIC DE FORMACIÓ PROFESSIONAL
Departamento de Informática y Comunicaciones
Index
• • • • • •
Workshop goals Type I (bare-metal) hypervisors An example: Proxmox Beyond virtualization Maintenance tasks: MV migration Setting up a HA environment
Bare-metal Hypervisors & High Availability Systems
2
Workshop goals
• To know how the production systems (really) work
Bare-metal Hypervisors & High Availability Systems
3
Workshop goals
• To know how the production systems (really) work • To know and implement the production virtualization: type I (or bare-metal)
Bare-metal Hypervisors & High Availability Systems
4
Workshop goals
• To know how the production systems (really) work • To know and implement the production virtualization: type I (or bare-metal) • To know a good (and free) virtualization platform: Proxmox
Bare-metal Hypervisors & High Availability Systems
5
Workshop goals
• To know how the production systems (really) work • To know and implement the production virtualization: type I (or bare-metal) • To know a good (and free) virtualization platform: Proxmox • To test this platform setting up an approach to a production environment Bare-metal Hypervisors & High Availability Systems
6
Workshop goals
• Why?
Bare-metal Hypervisors & High Availability Systems
7
• Why?
Workshop goals
• In my opinion most of us have never worked with this kind of systems
Bare-metal Hypervisors & High Availability Systems
8
Workshop goals
• Why? • In my opinion most of us have never worked with this kind of systems • It is important to know how they work in order to provide a valid systems view to our pupils
Bare-metal Hypervisors & High Availability Systems
9
Workshop goals
• Why? • In my opinion most of us have never worked with this kind of systems • It is important to know how they work in order to provide a valid systems view to our pupils • It would be an interesting end-ofyear project shared between different subjects Bare-metal Hypervisors & High Availability Systems
10
Type I (bare-metal) hypervisors
Bare-metal Hypervisors & High Availability Systems
11
• Type I hypervisors structure
Type I (bare-metal) hypervisors
OS 1
OS 2
…
OS N
HYPERVISOR (really OS+hypervisor)
HARDWARE
Bare-metal Hypervisors & High Availability Systems
12
Type I (bare-metal) hypervisors
• Advantages – Performance – Behaviour (less points of failure) – Production structures allowed
• Weak points – Non-obvious configuration – Dedicated server (of course)
Bare-metal Hypervisors & High Availability Systems
13
• Main examples
Type I (bare-metal) hypervisors
– VMWare ESXi • Difficult to configure • Expensive licenses
– Proxmox • Good balance performance/effort • Free
– Microsoft Hyper-V • Poor performance • Easy configuration
– Parallels Server Bare Metal – Xen Server Bare-metal Hypervisors & High Availability Systems
14
Proxmox
Bare-metal Hypervisors & High Availability Systems
15
• OS: – Debian
• Virtualization platform: – KVM+Containers
Proxmox
• Graphical remote access: – Java required
Bare-metal Hypervisors & High Availability Systems
16
Proxmox. Installation
• Downloaded from www.proxmox.org
Bare-metal Hypervisors & High Availability Systems
17
Installation. Key screens
e.g. ausiasHA
Bare-metal Hypervisors & High Availability Systems
18
Installation. Key screens
Bare-metal Hypervisors & High Availability Systems
19
After Installation. Web Access
Bare-metal Hypervisors & High Availability Systems
20
Node1
Bare-metal Hypervisors & High Availability Systems
21
Our first VM
Bare-metal Hypervisors & High Availability Systems
22
• Structure
Our First VM
VM1
VM2
…
VMn
Bare-metal Hypervisors & High Availability Systems
23
Our first VM. Upload an ISO
Bare-metal Hypervisors & High Availability Systems
24
Our first VM. Settings
Bare-metal Hypervisors & High Availability Systems
25
Our first VM. Settings
Bare-metal Hypervisors & High Availability Systems
26
Our first VM. Settings
Bare-metal Hypervisors & High Availability Systems
27
Our first VM. Settings
Bare-metal Hypervisors & High Availability Systems
28
Our first VM. Settings
Bare-metal Hypervisors & High Availability Systems
29
Our first VM
Bare-metal Hypervisors & High Availability Systems
30
Our first VM. Console
Bare-metal Hypervisors & High Availability Systems
31
Our first CT
Bare-metal Hypervisors & High Availability Systems
32
Our first CT
• What is a ‘CT’? • OpenVZ Container – Instead of trying to run an entire guest OS, container virtualization isolates the guests, – It doesn't try to virtualize the hardware. – Recommended for running GNU/Linux – Fastest approach
Bare-metal Hypervisors & High Availability Systems
33
Our first CT
Bare-metal Hypervisors & High Availability Systems
34
Our first CT
Bare-metal Hypervisors & High Availability Systems
35
Our first VM. Download
Bare-metal Hypervisors & High Availability Systems
36
Our Frist CT. Settings
Bare-metal Hypervisors & High Availability Systems
37
Our Frist CT. Settings
Bare-metal Hypervisors & High Availability Systems
38
Our Frist CT. Settings
Bare-metal Hypervisors & High Availability Systems
39
Our Frist CT. Settings
Bare-metal Hypervisors & High Availability Systems
40
Our Frist CT
Bare-metal Hypervisors & High Availability Systems
41
Statistics
Bare-metal Hypervisors & High Availability Systems
42
Our first CT. Working
Bare-metal Hypervisors & High Availability Systems
43
Our first cluster
Bare-metal Hypervisors & High Availability Systems
44
• Update packages
Let’s create a cluster
– In each node: aptitude update && aptitude full-upgrade
• Create a cluster – Master node: pvecm create – Node2: pvecm add IPMaster
– Node3:
NameCluster
pvecm add IPMaster
Bare-metal Hypervisors & High Availability Systems
45
Our first cluster
• Structure
Bare-metal Hypervisors & High Availability Systems
46
Our first cluster
Bare-metal Hypervisors & High Availability Systems
47
CT Migration
Bare-metal Hypervisors & High Availability Systems
48
CT Migration process
Bare-metal Hypervisors & High Availability Systems
49
CT Migration
Hot migration: it keeps working
Bare-metal Hypervisors & High Availability Systems
50
CT Migration
• This is not HA • Too much meatware • HA automates the process
Bare-metal Hypervisors & High Availability Systems
51
Our first HA cluster
Bare-metal Hypervisors & High Availability Systems
52
Our first HA cluster
• Structure
Management device
Network Shared storage
HA cluster Bare-metal Hypervisors & High Availability Systems
53
Our first HA cluster
• Structure
Management device
There are several critical points Network Shared storage
HA cluster Bare-metal Hypervisors & High Availability Systems
54
Implementing HA
• Before starting • Remove any previous VM • Add the NAS to the cluster
Bare-metal Hypervisors & High Availability Systems
55
Adding the NAS
Bare-metal Hypervisors & High Availability Systems
56
Adding the NAS
Bare-metal Hypervisors & High Availability Systems
57
Fencing
• Fencing?
Bare-metal Hypervisors & High Availability Systems
58
Fencing
• Fencing
Bare-metal Hypervisors & High Availability Systems
59
• If a node does not respond after a given time-threshold non-operational
Fencing
• Two types of fencing – Disabling a node itself, – Disallowing access to resources such as shared disks
Bare-metal Hypervisors & High Availability Systems
60
• If a node does not respond after a given time-threshold non-operational
Fencing
• Two types of fencing
STONITH
– Disabling a node itself – Disallowing access to resources such as shared disks Resource Fencing
Bare-metal Hypervisors & High Availability Systems
61
• In every node: nano /etc/default/redhat-cluster-pve
– Uncomment the line FENCE_JOIN="yes"
Fencing
– Join the fencing domain fence_tool join
Bare-metal Hypervisors & High Availability Systems
62
Fencing. Only in the Master
cp /etc/pve/cluster.conf /etc/pve/cluster.conf.new
nano /etc/pve/cluster.conf.new
• Increase the version number
• Validate the configuration ccs_config_validate -v -f /etc/pve/cluster.conf.new
Bare-metal Hypervisors & High Availability Systems
63
Fencing. Activate
Bare-metal Hypervisors & High Availability Systems
64
HA managed CT
Bare-metal Hypervisors & High Availability Systems
65
HA managed CT
Bare-metal Hypervisors & High Availability Systems
66
HA managed CT
Bare-metal Hypervisors & High Availability Systems
67
HA managed CT
Bare-metal Hypervisors & High Availability Systems
68
• In each node:
HA managed CT
/etc/init.d/rgmanager start
Bare-metal Hypervisors & High Availability Systems
69
HA managed CT
• Fencing devices – Managed switches – PS switches – Manual fencing – Scripting+pseudo manual fencing
Bare-metal Hypervisors & High Availability Systems
70
HA managed CT
• Fencing devices – Managed switches – PS switches – Manual fencing – Scripting+pseudo manual fencing
Bare-metal Hypervisors & High Availability Systems
71
/etc/pve/cluster.conf.new
Bare-metal Hypervisors & High Availability Systems
72
/etc/pve/cluster.conf.new
Bare-metal Hypervisors & High Availability Systems
73
Does it work?
• Start VM 100 in node1 • Poweroff node 1 (or disable the network) • Go to node2 or node3 • Manual fencing: fence_ack_manual node1
• Confirm with: absolutely
Bare-metal Hypervisors & High Availability Systems
74
Does it work?
Bare-metal Hypervisors & High Availability Systems
75
Thanks for your attendance Questions?
Slides available on: http://bit.ly/JRRuiz-HA
Bare-metal Hypervisors & High Availability Systems
76