Openvz User's Guide

Total Page:16

File Type:pdf, Size:1020Kb

Openvz User's Guide OpenVZ User’s Guide December 20, 2016 Parallels IP Holdings GmbH Vordergasse 59 8200 Schaffhausen Switzerland Tel: + 41 52 632 0411 Fax: + 41 52 672 2010 http://www.virtuozzo.com Copyright © 1999-2016 Parallels IP Holdings GmbH and its affiliates. All rights reserved. This product is protected by United States and international copyright laws. The product’s underlying technology, patents, and trademarks are listed at http://www.virtuozzo.com/legal/. Microsoft, Windows, Windows Server, Windows NT, Windows Vista, and MS-DOS are registered trademarks of Microsoft Corporation. Apple, Mac, the Mac logo, Mac OS, iPad, iPhone, iPod touch, FaceTime HD camera and iSight are trademarks of Apple Inc., registered in the US and other countries. Linux is a registered trademark of Linus Torvalds. All other marks and names mentioned herein may be trademarks of their respective owners. Table of Contents 1. Learning OpenVZ Basics ..................................................................................................................... 8 1.1. OpenVZ Overview ..................................................................................................................... 8 1.2. OS Virtualization Layer .............................................................................................................. 8 1.2.1. Basics of OS Virtualization ............................................................................................. 8 1.2.2. OpenVZ Containers ........................................................................................................ 9 1.2.2.1. OpenVZ Container Hardware ............................................................................ 10 1.2.3. Templates ..................................................................................................................... 10 1.3. Hardware Virtualization Layer ................................................................................................. 10 1.3.1. Hardware Virtualization Basics ..................................................................................... 11 1.3.2. OpenVZ Virtual Machines ............................................................................................. 11 1.3.2.1. Intel and AMD Virtualization Technology Support ............................................. 12 1.3.3. Virtual Machine Hardware ............................................................................................ 12 1.3.4. Virtual Machine Files .................................................................................................... 13 1.3.5. Support of Virtual and Real Media ............................................................................... 13 1.3.5.1. Supported Types of Hard Disks ........................................................................ 13 1.3.5.2. Virtual Hard Disks .............................................................................................. 13 1.3.5.3. Split disks ........................................................................................................... 13 1.3.5.4. CD/DVD Discs and Images ............................................................................... 14 1.4. OpenVZ Configuration ............................................................................................................. 14 1.5. Resource Management ........................................................................................................... 14 1.6. Physical Server Availability Considerations ............................................................................ 14 2. Managing Virtual Machines and Containers ...................................................................................... 16 2.1. Creating Virtual Machines and Containers .............................................................................. 16 2.1.1. Choosing OS EZ Templates for Containers ................................................................. 16 2.1.2. Creating Containers ...................................................................................................... 16 2.1.3. Creating Virtual Machines ............................................................................................ 17 2.1.4. Supported Guest Operating Systems ........................................................................... 17 2.1.4.1. Virtual Machines ................................................................................................ 17 2.1.4.2. Containers .......................................................................................................... 18 2.2. Performing Initial Configuration of Virtual Machines and Containers ...................................... 18 2.2.1. Using cloud-init for Virtual Machine Guest Initialization ................................................ 18 2.2.2. Installing OpenVZ Guest Tools .................................................................................... 19 2.2.3. Configuring Network Settings ....................................................................................... 19 2.2.4. Setting Passwords for Virtual Machines and Containers .............................................. 20 2.2.5. Setting Startup Parameters .......................................................................................... 20 2.3. Starting, Stopping, Restarting, and Querying Status of Virtual Machines and Containers ....... 21 2.3.1. Starting Virtual Machines and Containers .................................................................... 21 2.3.2. Stopping Virtual Machines and Containers .................................................................. 21 2.3.3. Restarting Virtual Machines and Containers ................................................................ 21 2.3.4. Checking Status of Virtual Machines and Containers .................................................. 22 2.4. Listing Virtual Machines and Containers ................................................................................. 22 2.5. Cloning Virtual Machines and Containers ............................................................................... 22 2.5.1. Configuring Default Directories ..................................................................................... 23 2.6. Suspending Virtual Machines and Containers ........................................................................ 23 2.7. Running Commands in Virtual Machines and Containers ....................................................... 24 2.8. Deleting Virtual Machines and Containers .............................................................................. 25 2.9. Viewing Detailed Information About Virtual Machines and Containers ................................... 25 2.10. Managing Templates ............................................................................................................. 26 2.10.1. Creating Templates .................................................................................................... 26 2.10.2. Listing Templates ........................................................................................................ 27 2.10.3. Deploying Templates .................................................................................................. 27 2.11. Managing Snapshots ............................................................................................................. 27 2.11.1. Creating Snapshots .................................................................................................... 28 2.11.1.1. Creating Virtual Machine Snapshots ............................................................... 28 2.11.1.2. Creating Container Snapshots ......................................................................... 28 2.11.1.3. Snapshot Branching ......................................................................................... 29 2.11.1.4. Restrictions and Recommendations ................................................................ 29 2.11.2. Listing Snapshots ....................................................................................................... 29 2.11.3. Reverting to Snapshots .............................................................................................. 30 2.11.4. Deleting Snapshots ..................................................................................................... 31 2.12. Migrating Virtual Machines and Containers .......................................................................... 31 2.12.1. Migrating Virtual Machines and Containers Between OpenVZ Servers ...................... 31 2.12.1.1. Offline Migration of Virtual Machines and Containers ...................................... 32 2.12.1.2. Live Migration of Virtual Machines and Containers ......................................... 32 2.13. Performing Container-specific Operations ............................................................................. 33 2.13.1. Reinstalling Containers ............................................................................................... 33 2.13.1.1. Customizing Container Reinstallation .............................................................. 33 2.13.2. Enabling VPN for Containers ..................................................................................... 34 2.13.3. Setting Up NFS Server in Containers ........................................................................ 35 2.13.4. Mounting NFS Shares on Container Start .................................................................
Recommended publications
  • Linux Virtualization Update
    Linux Virtualization Update Chris Wright <[email protected]> Japan Linux Symposium, November 2007 Intro Virtualization mini-summit Paravirtualization Full virtualization Hardware changes Libvirt Xen Virtualization Mini-summit June 25-27, 2007 ± Just before OLS in Ottawa. 18 attendees ● Xen, Vmware, KVM, lguest, UML, LinuxOnLinux ● x86, ia64, PPC and S390 Focused primarily on Linux as guest and areas of cooperation ● paravirt_ops and virtio Common interfaces ● Not the best group to design or discuss management interfaces ● Defer to libvirt, CIM, etc... ● CPUID 0x4000_00xx for hypervisor feature detection ● Can we get to common ABI for paravirt hybrid guest? Virtualization Mini-summit paravirt_ops ● Make use of existing abstractions wherever possible (clocksource, clockevents or irqchip) ● Could use a common lib/x86_emulate.c ● Open question: performance benefit of shadow vs. direct paging? Distro Issues ● Lack of feature parity between bare metal and Xen is difficult for distros ● Single binary kernel image ● Merge upstream Performance ● NUMA awareness lacking in Xen ± difficult for Altix ● Static NUMA representation doesn©t map well to dynamic virt environment ● Cooperative memory management ± guest memory hints Virtualization Mini-summit Hardware ● x86 and ia64 hardware virtualization roadmap ● ppc virtualization is gaining in embedded market, realtime requirments ● S390 ªhas an instruction for thatº Virtio ● Separate driver from transport ● Makes driver small, looks like a Linux driver and reusable ● Hypervisor specific
    [Show full text]
  • Ubuntu Server Guide Basic Installation Preparing to Install
    Ubuntu Server Guide Welcome to the Ubuntu Server Guide! This site includes information on using Ubuntu Server for the latest LTS release, Ubuntu 20.04 LTS (Focal Fossa). For an offline version as well as versions for previous releases see below. Improving the Documentation If you find any errors or have suggestions for improvements to pages, please use the link at thebottomof each topic titled: “Help improve this document in the forum.” This link will take you to the Server Discourse forum for the specific page you are viewing. There you can share your comments or let us know aboutbugs with any page. PDFs and Previous Releases Below are links to the previous Ubuntu Server release server guides as well as an offline copy of the current version of this site: Ubuntu 20.04 LTS (Focal Fossa): PDF Ubuntu 18.04 LTS (Bionic Beaver): Web and PDF Ubuntu 16.04 LTS (Xenial Xerus): Web and PDF Support There are a couple of different ways that the Ubuntu Server edition is supported: commercial support and community support. The main commercial support (and development funding) is available from Canonical, Ltd. They supply reasonably- priced support contracts on a per desktop or per-server basis. For more information see the Ubuntu Advantage page. Community support is also provided by dedicated individuals and companies that wish to make Ubuntu the best distribution possible. Support is provided through multiple mailing lists, IRC channels, forums, blogs, wikis, etc. The large amount of information available can be overwhelming, but a good search engine query can usually provide an answer to your questions.
    [Show full text]
  • Unprivileged GPU Containers on a LXD Cluster
    Unprivileged GPU containers on a LXD cluster GPU-enabled system containers at scale Stéphane Graber Christian Brauner LXD project leader LXD maintainer @stgraber @brau_ner https://stgraber.org https://brauner.io [email protected] [email protected] What are system containers? They are the oldest type of containers 01 BSD jails, Linux vServer, Solaris Zones, OpenVZ, LXC and LXD. They behave like standalone systems 02 No need for specialized software or custom images. No virtualization overhead 03 They are containers after all. LXD System nova-lxd command line tool your own client/script ? container LXD REST API manager LXD LXD LXD LXD LXC LXC LXC LXC Linux kernel Linux kernel Linux kernel Linux kernel Host A Host B Host C Host ... What LXD is Simple 01 Clean command line interface, simple REST API and clear terminology. Fast 02 Image based, no virtualization, direct hardware access. Secure 03 Safe by default. Combines all available kernel security features. Scalable 04 From a single container on a laptop to tens of thousands of containers in a cluster. What LXD isn’t Another virtualization technology 01 LXD offers an experience very similar to a virtual machine. But it’s still containers, with no virtualization overhead and real hardware. A fork of LXC 02 LXD uses LXC’s API to manage the containers behind the scene. Another application container manager 03 LXD only cares about full system containers. You can run whatever you want inside a LXD container, including Docker. LXD Main Certificates components Cluster Containers Snapshots Backups Events Images Aliases Networks Operations Projects Storage pools Storage volumes Snapshots LXD clustering Built-in clustering support 01 No external dependencies, all LXD 3.0 or higher installations can be instantly turned into a cluster.
    [Show full text]
  • Separating Protection and Management in Cloud Infrastructures
    SEPARATING PROTECTION AND MANAGEMENT IN CLOUD INFRASTRUCTURES A Dissertation Presented to the Faculty of the Graduate School of Cornell University in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy by Zhiming Shen December 2017 c 2017 Zhiming Shen ALL RIGHTS RESERVED SEPARATING PROTECTION AND MANAGEMENT IN CLOUD INFRASTRUCTURES Zhiming Shen, Ph.D. Cornell University 2017 Cloud computing infrastructures serving mutually untrusted users provide se- curity isolation to protect user computation and resources. Additionally, clouds should also support flexibility and efficiency, so that users can customize re- source management policies and optimize performance and resource utiliza- tion. However, flexibility and efficiency are typically limited due to security requirements. This dissertation investigates the question of how to offer flexi- bility and efficiency as well as strong security in cloud infrastructures. Specifically, this dissertation addresses two important platforms in cloud in- frastructures: the containers and the Infrastructure as a Service (IaaS) platforms. The containers platform supports efficient container provisioning and execut- ing, but does not provide sufficient security and flexibility. Different containers share an operating system kernel which has a large attack surface, and kernel customization is generally not allowed. The IaaS platform supports secure shar- ing of cloud resources among mutually untrusted users, but does not provide sufficient flexibility and efficiency. Many powerful management primitives en- abled by the underlying virtualization platform are hidden from users, such as live virtual machine migration and consolidation. The main contribution of this dissertation is the proposal of an approach in- spired by the exokernel architecture that can be generalized to any multi-tenant system to improve security, flexibility, and efficiency.
    [Show full text]
  • Openvz Forum Each Container
    Subject: I am thinking of moving to LXD Posted by votsalo on Wed, 17 Aug 2016 19:13:50 GMT View Forum Message <> Reply to Message I am thinking of moving my dedicated server to LXD (a variant of LXC). One reason is that I can run LXD on several different environments where I can run Ubuntu: * On a dedicated server. * On an Amazon EC2 instance. * On my home machine, running Ubuntu desktop. * On a cheap Ubuntu 16.04 Openstack KVM VPS. I find the VPS option very usuful, however tricky because of the tight disk space. I can have a few containers on my VPS. I can move containers between the VPS and another LXD server. I can run a container OS that I need on my VPS that is not offered as a choice by my VPS provider, but is available as an LXD template. And perhaps I can replace the dedicated server with a few cheaper VPSs. I have tried doing all these with OpenVZ in the past. I couldn't get it to run anywhere, except on the dedicated server or on a dedicated home machine (or dual boot). Now it seems that I cannot run OpenVZ 7.0.0 on any of the above infrastructure. I have installed OpenVZ 7.0.0 on my home machine, as a dual boot, but I'm not using it, since I use my desktop OS and I cannot use both at the same time. In the past I tried installing OpenVZ on several desktop distributions, but I couldn't find one that worked.
    [Show full text]
  • Security of OS-Level Virtualization Technologies: Technical Report
    Security of OS-level virtualization technologies Elena Reshetova1, Janne Karhunen2, Thomas Nyman3, N. Asokan4 1 Intel OTC, Finland 2 Ericsson, Finland 3 University of Helsinki, Finland 4 Aalto University and University of Helsinki, Finland Abstract. The need for flexible, low-overhead virtualization is evident on many fronts ranging from high-density cloud servers to mobile devices. During the past decade OS-level virtualization has emerged as a new, efficient approach for virtualization, with implementations in multiple different Unix-based systems. Despite its popularity, there has been no systematic study of OS-level virtualization from the point of view of security. In this report, we conduct a comparative study of several OS- level virtualization systems, discuss their security and identify some gaps in current solutions. 1 Introduction During the past couple of decades the use of different virtualization technolo- gies has been on a steady rise. Since IBM CP-40 [19], the first virtual machine prototype in 1966, many different types of virtualization and their uses have been actively explored both by the research community and by the industry. A relatively recent approach, which is becoming increasingly popular due to its light-weight nature, is Operating System-Level Virtualization, where a number of distinct user space instances, often referred to as containers, are run on top of a shared operating system kernel. A fundamental difference between OS-level virtualization and more established competitors, such as Xen hypervisor [24], VMWare [48] and Linux Kernel Virtual Machine [29] (KVM), is that in OS-level virtualization, the virtualized artifacts are global kernel resources, as opposed to hardware.
    [Show full text]
  • Container Technologies
    Zagreb, NKOSL, FER Container technologies Marko Golec · Juraj Vijtiuk · Jakov Petrina April 11, 2020 About us ◦ Embedded Linux development and integration ◦ Delivering solutions based on Linux, OpenWrt and Yocto • Focused on software in network edge and CPEs ◦ Continuous participation in Open Source projects ◦ www.sartura.hr Introduction to GNU/Linux ◦ Linux = operating system kernel ◦ GNU/Linux distribution = kernel + userspace (Ubuntu, Arch Linux, Gentoo, Debian, OpenWrt, Mint, …) ◦ Userspace = set of libraries + system software Linux kernel ◦ Operating systems have two spaces of operation: • Kernel space – protected memory space and full access to the device’s hardware • Userspace – space in which all other application run • Has limited access to hardware resources • Accesses hardware resources via kernel • Userspace applications invoke kernel services with system calls User applications E.g. bash, LibreOffice, GIMP, Blender, Mozilla Firefox, etc. System daemons: Windowing system: User mode Low-level system systemd, runit, logind, X11, Wayland, Other libraries: GTK+, Qt, EFL, SDL, SFML, Graphics: Mesa, AMD components networkd, PulseAudio, SurfaceFlinger FLTK, GNUstep, etc. Catalyst, … … (Android) C standard library Up to 2000 subroutines depending on C library (glibc, musl, uClibc, bionic) ( open() , exec() , sbrk() , socket() , fopen() , calloc() , …) About 380 system calls ( stat , splice , dup , read , open , ioctl , write , mmap , close , exit , etc.) Process scheduling Memory management IPC subsystem Virtual files subsystem Network subsystem Kernel mode Linux Kernel subsystem subsystem Other components: ALSA, DRI, evdev, LVM, device mapper, Linux Network Scheduler, Netfilter Linux Security Modules: SELinux, TOMOYO, AppArmor, Smack Hardware (CPU, main memory, data storage devices, etc.) TABLE 1 Layers within Linux Virtualization Virtualization Concepts Two virtualization concepts: ◦ Hardware virtualization (full/para virtualization) • Emulation of complete hardware (virtual machines - VMs) • VirtualBox, QEMU, etc.
    [Show full text]
  • L4 – Virtualization and Beyond
    L4 – Virtualization and Beyond Hermann Härtig!," Michael Roitzsch! Adam Lackorzynski" Björn Döbel" Alexander Böttcher! #!Department of Computer Science# "GWT-TUD GmbH # Technische Universität Dresden# 01187 Dresden, Germany # 01062 Dresden, Germany {haertig,mroi,adam,doebel,boettcher}@os.inf.tu-dresden.de Abstract Mac OS X environment, using full hardware After being introduced by IBM in the 1960s, acceleration by the GPU. Virtual machines are virtualization has experienced a renaissance in used to test potentially malicious software recent years. It has become a major industry trend without risking the host environment and they in the server context and is also popular on help developers in debugging crashes with back- consumer desktops. In addition to the well-known in-time execution. benefits of server consolidation and legacy In the server world, virtual machines are used to preservation, virtualization is now considered in consolidate multiple services previously located embedded systems. In this paper, we want to look on dedicated machines. Running them within beyond the term to evaluate advantages and virtual machines on one physical server eases downsides of various virtualization approaches. management and helps saving power by We show how virtualization can be increasing utilization. In server farms, migration complemented or even superseded by modern of virtual machines between servers is used to operating system paradigms. Using L4 as the balance load with the potential of shutting down basis for virtualization and as an advanced completely unloaded servers or adding more to microkernel provides a best-of-both-worlds increase capacity. Lastly, virtual machines also combination. Microkernels can contribute proven isolate different customers who can purchase real-time capabilities and small trusted computing virtual shares of a physical server in a data center.
    [Show full text]
  • Multiple Instances of the Global Linux Namespaces
    Multiple Instances of the Global Linux Namespaces Eric W. Biederman Linux Networx [email protected] Abstract to create a clean implementation that can be merged into the Linux kernel. The discussion has begun on the linux-kernel list and things are Currently Linux has the filesystem namespace slowly progressing. for mounts which is beginning to prove use- ful. By adding additional namespaces for pro- cess ids, SYS V IPC, the network stack, user ids, and probably others we can, at a trivial 1 Introduction cost, extend the UNIX concept and make novel uses of Linux possible. Multiple instances of a namespace simply means that you can have two 1.1 High Performance Computing things with the same name. For servers the power of computers is growing, and it has become possible for a single server I have been working with high performance to easily fulfill the tasks of what previously re- clusters for several years and the situation is quired multiple servers. Hypervisor solutions painful. Each Linux box in the cluster is ref- like Xen are nice but they impose a perfor- ered to as a node, and applications running or mance penalty and they do not easily allow re- queued to run on a cluster are jobs. sources to be shared between multiple servers. Jobs are run by a batch scheduler and, once For clusters application migration and preemp- launched, each job runs to completion typically tion are interesting cases but almost impossibly consuming 99% of the resources on the nodes hard because you cannot restart the application it is running on.
    [Show full text]
  • Openvz Command Line Reference
    OpenVZ Command Line Reference December 20, 2016 Parallels IP Holdings GmbH Vordergasse 59 8200 Schaffhausen Switzerland Tel: + 41 52 632 0411 Fax: + 41 52 672 2010 http://www.virtuozzo.com Copyright © 1999-2016 Parallels IP Holdings GmbH and its affiliates. All rights reserved. This product is protected by United States and international copyright laws. The product’s underlying technology, patents, and trademarks are listed at http://www.virtuozzo.com/legal/. Microsoft, Windows, Windows Server, Windows NT, Windows Vista, and MS-DOS are registered trademarks of Microsoft Corporation. Apple, Mac, the Mac logo, Mac OS, iPad, iPhone, iPod touch, FaceTime HD camera and iSight are trademarks of Apple Inc., registered in the US and other countries. Linux is a registered trademark of Linus Torvalds. All other marks and names mentioned herein may be trademarks of their respective owners. Table of Contents 1. Introduction ........................................................................................................................................... 6 1.1. About OpenVZ ........................................................................................................................... 6 1.2. About This Guide ...................................................................................................................... 7 2. Managing OpenVZ ............................................................................................................................... 8 2.1. OpenVZ Configuration Files .....................................................................................................
    [Show full text]
  • Lightweight Virtualization: LXC Vs. Openvz
    Lightweight virtualization: LXC vs. OpenVZ Christoph Mitasch Technology Specialist Thomas-Krenn.AG Linuxtag Berlin, 11.5.2011 Agenda 1) Virtualisierungstypen 2) OpenVZ 3) LXC 4) OpenVZ vs. LXC 5) Libvirt Support, Pacemaker 6) Migration OpenVZ → LXC 2/32 Virtualisierungstypen • Hardware Virtualisierung – Full: unmodified Guest OS – Para: modified Guest OS • Software Virtualisierung – Applikations-Virtualisierung – OS-level • Linux – OpenVZ – Linux VServer – LXC • Solaris: Containers/Zones • FreeBSD: Jails Quelle: http://www.parallels.com/eu/products/pvc46/info/virtualization/ 3/32 Welche Virtualisierung für was? Idee: http://events.linuxfoundation.org/slides/lfcs2010_kolyshkin.pdf OpenVZ Quelle: http://perfohost.com/kvm.vps.html 4/32 Welche Virtualisierung für was? Fahrrad vs. Auto Auto vs. Fahrrad Feature Fahrrad Auto Feature Auto Fahrrad Umweltfreundlich Ja Nein Geschwindigkeit Hoch Niedrig Preis Niedrig Hoch Klimatisierung Ja Nein Treibstoff benötigt Nein Ja Mitfahrer Ja max. 1 Hält fit Ja Nein Ladekapazität Hoch Niedrig Geräusch-Level Niedrig Hoch ABS Ja Nein Führerschein notwendig Nein Ja Gaspedal Ja Nein Parkplatz benötigt Nein Ja Elektrische Fensterheber Ja Nein Quelle: http://wiki.openvz.org/Bike_vs_car 5/32 OpenVZ – History • kommerzielles Produkt „Virtuozzo“ seit 2001 • OpenVirtuozzo → OpenVZ • Großteil von Virtuozzo seit 2005 unter GPL als OpenVZ verfügbar • großer Kernel Patch – RHEL 5 Kernel: 2,7 Mio LoC bzw. 85 MB unkomprimiert → komplette Mainline Inclusion unwahrscheinlich – Teile von OpenVZ werden in Mainline aufgenommen
    [Show full text]
  • Contents This Week with My Coleco ADAM 0009.18
    Contents This Week With My Coleco ADAM 0009.18 ............................................................................................ 9 I. Address Book Patch for ADAMserve. ............................................................................................... 9 II. SmartFiler Patch to Enable Database Creation Under ADAMserve/HARDDISK. .................. 10 III. Next Time. ....................................................................................................................................... 11 This Week With My Coleco ADAM 0009.10 .......................................................................................... 12 I. Finding a New Home for the TWWMCA Archive. .......................................................................... 12 II. Converting TWWMCA Plaintext to HTML. .................................................................................. 12 III. Sample HTML Converter Input and Output Text. .................................................................... 13 I. Administrivia. .................................................................................................................................... 17 II. Sample Numbered List. ................................................................................................................... 17 III. Sample Code Listing. ..................................................................................................................... 17 IV. Next Time. ......................................................................................................................................
    [Show full text]