Logical Domains - UKUUG

Logical Domains - UKUUG Logical Domains - UKUUG

<strong>Logical</strong> <strong>Domains</strong><br />

Liam Merwick<br />

Sun Microsystems, Inc.


Contents<br />

• Background<br />

• Components<br />

• Features<br />

• Architecture<br />

• Configuration Examples<br />

• Q & A<br />

Page: 2


Page: 3<br />

Background


Consolidation<br />

• Conventional Unix server utilisation is 7 to 15%<br />

• Data center compression<br />

> Goal: Increase utilisation of equipment<br />

10% Utilisation<br />

20%<br />

Time<br />

10%<br />

Page: 4


Solutions from Sun<br />

Hard Partitions Virtual Machines OS Virtualisation Resource Mgmt.<br />

App<br />

Server<br />

Database<br />

Identity<br />

Server<br />

File<br />

Server<br />

Web<br />

Server<br />

Mail<br />

Server<br />

Calendar<br />

Server<br />

Database<br />

Web<br />

Server<br />

SunRay<br />

Server<br />

Database<br />

App<br />

Server<br />

App<br />

OS<br />

Server<br />

Multiple OSes Single OS<br />

Trend to flexibility<br />

Dynamic System <strong>Domains</strong><br />

SPARC <strong>Logical</strong> <strong>Domains</strong><br />

Solaris Xen<br />

Solaris Containers<br />

(Zones + SRM)<br />

Trend to isolation<br />

Solaris Resource Manager<br />

(SRM)<br />

VMware ESX<br />

Microsoft Virtual Server<br />

Solaris Containers<br />

for Linux Applications<br />

Solaris Trusted Extensions<br />

Page: 5


Virtualisation for SPARC platforms<br />

• New “sun4v” architecture<br />

Operating<br />

System<br />

Solaris X<br />

update<br />

(genunix)<br />

sun4u code<br />

Solaris X<br />

(genunix)<br />

Solaris X (sun4v)<br />

US-Z CPU<br />

code<br />

sun4v<br />

interface<br />

CPU “Z”<br />

SPARC hypervisor<br />

SPARC CPU<br />

Page: 6<br />

Platform


Virtual Machine for SPARC<br />

• Thin software layer between OS and<br />

platform hardware<br />

• Hypervisor + sun4v interface<br />

• Virtualises machine HW and isolates OS from<br />

register-level<br />

• Delivered with platform not OS<br />

• Not itself an OS<br />

sun4v virtual machine<br />

User<br />

App<br />

OpenBoot<br />

User<br />

App<br />

Solaris<br />

Hypervisor<br />

User<br />

App<br />

SPARC hardware<br />

stable<br />

interface<br />

“sun4v”<br />

Page: 7


<strong>Logical</strong> <strong>Domains</strong><br />

• Partitioning capability<br />

> Create virtual<br />

machines each with<br />

sub-set of resources<br />

> Protection & Isolation<br />

using HW+firmware<br />

combination<br />

LDom 1<br />

Solaris 10<br />

App<br />

App<br />

LDom 2<br />

Solaris 10<br />

App<br />

App<br />

Zone<br />

LDom 3<br />

Solaris<br />

Express<br />

App<br />

App<br />

Zone 1<br />

App<br />

App<br />

Zone 2<br />

Hypervisor<br />

Hardware<br />

Shared CPU,<br />

Memory, IO<br />

CPU<br />

Mem<br />

CPU<br />

Mem<br />

CPU<br />

Mem<br />

CPU<br />

I/O<br />

Page: 8


<strong>Logical</strong> <strong>Domains</strong> Technology<br />

• Virtualisation and partitioning of machine resources<br />

> Each domain is a full virtual machine, with a dynamically reconfigurable subset<br />

of machine resources, and its own independent OS<br />

> Protection & isolation via SPARC hardware and LDoms Hypervisor firmware<br />

LDom A<br />

LDom B LDom C LDom D<br />

OS<br />

Environment<br />

of choice<br />

Linux<br />

FreeBSD<br />

LDoms<br />

Hypervisor<br />

Platform<br />

Hardware<br />

CPU CPU CPU CPU CPU CPU CPU CPU<br />

Memory<br />

Memory Memory Memory<br />

I/O I/O<br />

Page: 9


Coupled with Throughput Computing<br />

• Industry trend to many cores & strands per chip<br />

> Most applications don't scale well<br />

> Even Solaris doesn't scale perfectly<br />

• Ability to dynamically partition system matches<br />

throughput computing model<br />

> Can run multiple services and OS instances on same<br />

box / chip<br />

> More flexibly be able to utilise available compute power<br />

Page: 10


Page: 11<br />

Components


Page: 12<br />

Components – Hardware & Software<br />

• Hardware<br />

> UltraSPARC-T1 (Niagara) family of CMT processors<br />

> T1000 Netra CP3060<br />

> T2000 Netra T2000<br />

• Operating System<br />

> Solaris 10 11/06 (U3) + patches<br />

> OpenSolaris (build 57+ recommended)<br />

• Firmware<br />

> 6.4.0<br />

• LDoms Manager Software<br />

> 1.0 (Solaris package - available as Free download)


Page: 13<br />

Features


Fundamentals<br />

• Each virtual machine should appear as an entirely<br />

independent machine<br />

> own kernel, patches, tuning parameters<br />

> own user accounts, administrators<br />

> own disks<br />

> own network interfaces, MAC & IP addresses<br />

> Start, stop and reboot independently of each other<br />

• Paravirtualised OS<br />

Page: 14


Features<br />

• Add and remove cpus while OS is running<br />

• Protection and isolation via SPARC hardware and<br />

LDoms Hypervisor firmware<br />

• Service domains for I/O<br />

> direct I/O access<br />

Page: 15


Features – UltraSPARC-T1 specific<br />

• Up to 32 LDoms per box<br />

> CPU threads individually assignable to different LDoms<br />

• Memory assignable to with an 8KB granularity<br />

• Two PCI busses independently assignable to the<br />

same or different LDoms.<br />

• Guest <strong>Domains</strong> can be configured, started and<br />

stopped independently<br />

> Without requiring a power-cycle of machine<br />

Page: 16


Page: 17<br />

Architecture


Architecture<br />

• <strong>Logical</strong> <strong>Domains</strong> overview<br />

• Hypervisor<br />

• LDoms Manager<br />

• Virtualised I/O<br />

• Dynamic Reconfiguration (DR)<br />

Page: 18


Hypervisor Support<br />

• Hypervisor software is responsible for maintaining<br />

separation between domains<br />

> Using extensions built into a sun4v CPU<br />

• Also provides <strong>Logical</strong> Domain Channels (LDCs) so<br />

that domains can communicate with each other<br />

> Mechanism by which domains can be virtually networked<br />

with each other, or provide services to each other<br />

Page: 19


LDoms Manager<br />

• One Manager per host HV<br />

> Controls Hypervisor and all its LDoms<br />

• Exposes control interface via CLI<br />

• Maps <strong>Logical</strong> <strong>Domains</strong> to physical resources<br />

> Constraint engine<br />

> Heuristic binding of LDoms to resources<br />

> Assists with performance optimisation<br />

> Assists in event of failures / blacklisting<br />

Page: 20


<strong>Logical</strong> <strong>Domains</strong><br />

File<br />

Server<br />

Web<br />

Server<br />

Mail<br />

Server<br />

Application<br />

OS<br />

Server<br />

Page: 21


Direct I/O<br />

<strong>Logical</strong> Domain<br />

• Traditional model<br />

> Existing drivers and devices<br />

continue to work<br />

App<br />

App<br />

App<br />

Device Driver<br />

/pci@B/qlc@6<br />

<strong>Logical</strong> Domain<br />

owns PCI root<br />

and tree<br />

Nexus Driver<br />

Privileged<br />

/pci@B<br />

Hyper<br />

Privileged<br />

Hypervisor<br />

Virtual Nexus I/F<br />

Hardware<br />

I/O<br />

Bridge<br />

I/O MMU<br />

PCI<br />

Root<br />

PCI-Express<br />

Page: 22


Virtualised I/O<br />

Privileged<br />

<strong>Logical</strong><br />

Domain A<br />

App<br />

App<br />

App<br />

App<br />

Virtual Device<br />

Driver<br />

Service<br />

Domain<br />

Virtual Device<br />

Service<br />

Device Driver<br />

/pci@B/qlc@6<br />

Nexus Driver<br />

/pci@B<br />

Hyper<br />

Privileged<br />

Hypervisor<br />

Domain Channel<br />

Virtual Nexus I/F<br />

Hardware<br />

I/O MMU<br />

PCI<br />

Roo<br />

t<br />

I/O<br />

Bridge<br />

PCI B<br />

Page: 23


Virtual (Block) Disk device<br />

<strong>Logical</strong> Domain<br />

1<br />

App<br />

App<br />

App<br />

App<br />

<strong>Logical</strong><br />

Domain 2<br />

App<br />

App<br />

App<br />

App<br />

<strong>Logical</strong><br />

Domain 3<br />

App<br />

App<br />

App<br />

App<br />

Service<br />

Domain<br />

vDisk<br />

Server<br />

vDisk<br />

Server<br />

vDisk<br />

client<br />

Driver<br />

vDisk<br />

client<br />

driver<br />

vDisk<br />

client<br />

driver<br />

Device-<br />

Driver<br />

Hypervisor<br />

Virtual SAN 1<br />

Virtual SAN 2<br />

I/O Bridge<br />

FC-AL<br />

I/F<br />

Page: 24


Virtual Ethernet device<br />

<strong>Logical</strong><br />

Domain 1<br />

App<br />

App<br />

App<br />

App<br />

<strong>Logical</strong><br />

Domain 2<br />

App<br />

App<br />

App<br />

App<br />

<strong>Logical</strong><br />

Domain 3<br />

App<br />

App<br />

App<br />

App<br />

Service<br />

Domain<br />

V-Ether<br />

Switch<br />

V-Ether<br />

Switch<br />

V-Ether<br />

Driver<br />

V-Ether<br />

Driver<br />

V-Ether<br />

Driver<br />

Device-<br />

Driver<br />

Hypervisor<br />

Virtual LAN 1: 192.168.0/24<br />

Virtual LAN 2: 63.24/16<br />

I/O Bridge<br />

Gb<br />

Ether I/F<br />

Page: 25


Dynamic Reconfiguration (DR)<br />

• Ability to dynamically grow or shrink compute<br />

capacity of an LDom on demand<br />

• No need to re-boot Solaris<br />

• Simply add / remove:<br />

> CPUs<br />

> Memory (future)<br />

> I/O (future)<br />

• Improve utilisation by balancing resources between<br />

LDoms<br />

Page: 26


LDoms Manager<br />

<strong>Logical</strong><br />

Domain 1<br />

App<br />

App<br />

App<br />

App<br />

<strong>Logical</strong><br />

Domain 2<br />

App<br />

App<br />

App<br />

<strong>Logical</strong><br />

Domain 3<br />

App<br />

App<br />

App<br />

Service<br />

Domain<br />

LDoms<br />

Manager<br />

OS DR<br />

Stack<br />

OS DR<br />

Stack<br />

OS DR<br />

Stack<br />

Hypervisor<br />

HV DR<br />

Stack<br />

Page: 27


Example: vCPU reconfiguration<br />

<strong>Logical</strong><br />

Domain 1<br />

App App<br />

<strong>Logical</strong><br />

Domain 1<br />

App App<br />

<strong>Logical</strong><br />

Domain 2<br />

App App<br />

V<br />

V<br />

V<br />

V<br />

V<br />

P<br />

P<br />

Hypervisor<br />

Hypervisor<br />

P P<br />

P<br />

Example command line operations:<br />

% ldm remove-vcpu 1 <strong>Logical</strong>_Domain_1<br />

% ldm add-vcpu 1 <strong>Logical</strong>_Domain_2<br />

Page: 28


Page: 29<br />

Configuration<br />

Examples


Configuring a machine to run LDoms<br />

• Make resources available (remove from control domain)<br />

primary#> ldm set-mau 2 primary<br />

primary#> ldm set-vcpu 8 primary<br />

primary#> ldm set-mem 8g primary<br />

• Configure services<br />

primary#> ldm add-vcc port-range=5000-5100 primary-vcc0 primary<br />

primary#> ldm add-vds primary-vds0 primary<br />

primary#> ldm add-vsw net-dev=e1000g0 primary-vsw0 primary<br />

Page: 30


Adding another domain (I)<br />

• Add disk device<br />

primary#> ldm add-vdsdev /dev/dsk/c1t0d0s2 vol1@primary-vds0<br />

• Adding resources<br />

primary#> ldm create domain1<br />

primary#> ldm add-mem 2g domain1<br />

primary#> ldm add-vcpu 4 domain1<br />

primary#> ldm add-vdisk vdisk1 vol1@primary-vds0 domain1<br />

primary#> ldm add-vnet vnet1 primary-vsw0 domain1<br />

• Show domain constraints<br />

primary#> ldm list -l domain1<br />

Page: 31


Adding another domain (II)<br />

• Booting the newly created domain<br />

primary#> ldm bind domain1<br />

primary#> ldm start domain1<br />

• Connect to the console<br />

primary#> telnet localhost 5000<br />

Page: 32


More information<br />

• BigAdmin Portal<br />

> http://www.sun.com/bigadmin/hubs/ldoms/<br />

• Sun Blueprint<br />

> Beginners Guide to LDoms: Understanding and Deploying<br />

<strong>Logical</strong> <strong>Domains</strong><br />

> http://www.sun.com/blueprints/0207/820-0832.pdf<br />

Page: 33


<strong>Logical</strong> <strong>Domains</strong><br />

Liam Merwick<br />

Liam.Merwick@Sun.COM<br />

LDoms Development<br />

SPARC Platform Software<br />

34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!