How To Convert Physical Systems And Xen VMs Into OpenVZ Containers (Debian Etch)

Similar documents
Some Tips On OpenVZ Deployment

KVM Guest Management With Virt-Manager On Ubuntu 8.10

Back Up/Restore Hard Drives And Partitions With CloneZilla Live

Managing Xen With Xen-Tools, Xen-Shell, And Argo

Installing memcached And The PHP5 memcache Module On Debian Etch (Apache2)

Installing MyDNS And The MyDNSConfig Control Panel On Fedora 8

Recover Deleted Files With Scalpel

Chrooted SFTP With MySecureShell On Debian Etch

KVM Virtualization With Enomalism 2 On An Ubuntu 8.10 Server

Xen: How to Convert An Image-Based Guest To An LVM-Based Guest

How To Resize ext3 Partitions Without Losing Data

Monitoring Network Latency With Smokeping (Debian Etch)

Preventing Brute Force Attacks With Fail2ban On Debian Etch

Setting Up Master-Master Replication With MySQL 5 On Debian Etch

How To Compile A Kernel - The Mandriva Way

Install Apache, PHP And MySQL On CentOS 7 (LAMP)

Back Up (And Restore) LVM Partitions With LVM Snapshots

5/8/2012. Creating and Changing Directories Chapter 7

commands exercises Linux System Administration and IP Services AfNOG 2015 Linux Commands # Notes

Lab Working with Linux Command Line

HANDS UP IF YOU DON T HAVE A VM OR IF YOU DON T REMEMBER YOUR PASSWORDS. Or something broke

CTEC1863/2018F Bonus Lab Page 1 of 5

How To Set Up A Postfix Autoresponder With Autoresponse

OpenVZ Essentials. Create and administer virtualized containers on your server using the robust OpenVZ. Mark Furman BIRMINGHAM - MUMBAI

Hawk Server for Linux. Installation Guide. Beta Version MHInvent Limited. All rights reserved.

Open Source Virtualization - Software Freedom Day 2008

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

CSE 390a Lecture 2. Exploring Shell Commands, Streams, and Redirection

WEBHOSTS, ISPS & RESELLERS SETUP REQUIREMENTS & SIGNUP FORM LOCAL CLOUD

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

SQL Server vnext on Linux Ubuntu - Part 1

Travis Cardwell Technical Meeting

The Perfect Xen Setup For Debian Sarge

Introduction to Linux

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Linux Essentials Objectives Topics:

CSE 390a Lecture 2. Exploring Shell Commands, Streams, Redirection, and Processes

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

Linux Systems Administration Getting Started with Linux

Unit- 5. Linux Systems

Network Monitoring & Management. A few Linux basics

Installation Manual InfraManage.NET Installation Instructions for Ubuntu

Get VirtualBox. VirtualBox/Ubuntu Setup. Go to and select Downloads.

PiCloud. Building owncloud on a Raspberry PI

Introduction to Linux

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

Using iscsi On Debian Lenny (Initiator And Target)

Checking Hard Disk Sanity With Smartmontools (Debian & Ubuntu)

Ubuntu Manually Mount Cdrom Drive Command Line Vmware

CS197U: A Hands on Introduction to Unix

Physics REU Unix Tutorial

Setting Up A High-Availability Load Balancer (With Failover and Session Support) With HAProxy/Wackamole/Spread On Debian Etch

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

Introduction of Linux

Lab 0 Getting Started. Sistemas Operativos: Práctica 0 1

Setting Up PHPlist (Open-Source Newsletter Manager)

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers

Exam LFCS/Course 55187B Linux System Administration

rsync link-dest Local, rotated, quick and useful backups!

d. Permissions 600 on directory dir and 300 on file dir/foo. c. Permissions 700 on directory dir and 200 on file dir/foo.

Unix System Architecture, File System, and Shell Commands

CSDA UNIT I. Introduction to the LAB environment. Practical classes Lab 0. Computer Engineering Degree Computer Engineering.

Using KVM On Ubuntu 7.10 (Gutsy Gibbon)

Perl and R Scripting for Biologists

Chapter-3. Introduction to Unix: Fundamental Commands

TECHNICAL WHITE PAPER. Using Stateless Linux with Veritas Cluster Server. Linux

Filesystem Hierarchy Operating systems I800 Edmund Laugasson

Sponsored Links Bash Like

Getting your department account

Linux & Shell Programming 2014

Outline. Cgroup hierarchies

UNIX Tutorial Two

How To Search For Missing Packages With apt-file On Debian and Ubuntu

Integration Guide. SafeGuard CryptoServer PCI in Xen Environment Debian 5

OpenVZ User s Guide December 20, 2016

Singularity: container formats

Guideline for the installation of the free C-MOR Video Surveillance Virtual Machine on VirtualBox

Spring 2017 :: CSE 506. Introduction to. Virtual Machines. Nima Honarmand

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Upgrade Guide. This document details the upgrade process for customers moving from the full version of OnApp Cloud v2.3.1 to v2.3.2.

The TinyHPC Cluster. Mukarram Ahmad. Abstract

Introduction to remote command line Linux. Research Computing Team University of Birmingham

Server Consolidation with Xen Farming

Manage Directories and Files in Linux. Objectives. Understand the Filesystem Hierarchy Standard (FHS)

Quick Start Guide for BeagleBone. Table of Contents. by Brian Fraser Last update: Sept 24, 2017

cpouta exercises

Outline. Cgroup hierarchies

Automatic Creation of a Virtual Network with VBoxManage [1]

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual

puppet-diamond Documentation

Install and Configure Ubuntu on a VirtualBox Virtual Machine

Lab E2: bypassing authentication and resetting passwords

How To Repair MySQL Replication

Virtualbox Mount Shared Folder Ubuntu Permission Denied

Citrix CloudPlatform (powered by Apache CloudStack) Version Patch D Release Notes. Revised July 02, :15 pm Pacific

Course 55187B Linux System Administration

More Raspian. An editor Configuration files Shell scripts Shell variables System admin

GNU/Linux: An Essential Guide for Students Undertaking BLOSSOM

CST8207: GNU/Linux Operating Systems I Lab Six Linux File System Permissions. Linux File System Permissions (modes) - Part 1

Virtual Data Center (vdc) Manual

Transcription:

By Falko Timme Published: 2009-01-14 18:01 How To Convert Physical Systems And Xen VMs Into OpenVZ Containers (Debian Etch) Version 1.0 Author: Falko Timme <ft [at] falkotimme [dot] com> Last edited 12/17/2008 This guide explains how you can convert physical systems (running Debian Etch) or Xen domus (also running Debian Etch) into an OpenVZ container. This procedure should also work for converting VMware VMs, VirtualBox VMs, or KVM VMs into OpenVZ containers, but I haven't tried this. It should work for other Linux distributions as well, with minor modifications (for example, the network configuration is not located in /etc/network/interfaces if you're not on Debian/Ubuntu). I do not issue any guarantee that this will work for you! 1 Preliminary Note I want to convert the physical system or Xen domu server1.example.com (with the IP address 192.168.0.100) into an OpenVZ container. I have a second server, server2.example.com, where I have set up OpenVZ according to this guide: Installing And Using OpenVZ On Debian Etch. I will use the VEID 211 for the new OpenVZ container on server2.example.com. I will use /vz here as the OpenVZ directory, so make sure that /vz is a symlink to /var/lib/vz: ln -s /var/lib/vz /vz 2 Converting server1.example.com To OpenVZ Copyright 2009 All Rights Reserved. HowtoForge Page 1 of 5

First we create two empty directories for the new OpenVZ container 211 on server2 and also a standard OpenVZ configuration file for the new container: mkdir /vz/root/211 /vz/private/211 cat /etc/vz/conf/ve-vps.basic.conf-sample > /etc/vz/conf/211.conf Next we install rsync on both systems as we will use rsync to transfer the files from server1 to the OpenVZ container: server1/ apt-get install rsync Now let's transfer server1's files to the OpenVZ container: rsync -arvpz --numeric-ids --exclude dev --exclude proc --exclude tmp -e "ssh -l root@192.168.0.100" root@192.168.0.100:/ /vz/private/211/ This can take a few minutes, depending on the number and size of the files on server1. Afterwards, we can configure our new OpenVZ container with the vzctl command, as you would do if you would create a new container from scratch. OpenVZ needs to know which distribution is used in the container, therefore we must set the OSTEMPLATE value: vzctl set 211 --ostemplate debian-4.0-i386-minimal --save Copyright 2009 All Rights Reserved. HowtoForge Page 2 of 5

Afterwards, you can set the network parameters and also the disk space of the new container: vzctl set 211 --onboot yes --save vzctl set 211 --hostname server1.example.com --save vzctl set 211 --ipadd 192.168.0.100 --save vzctl set 211 --numothersock 120 --save vzctl set 211 --nameserver 145.253.2.75 --nameserver 213.191.92.86 --save vzctl set 211 --diskspace 10000000:11000000 --save (This would set a disk space soft limit of 10GB and a hard limit of 11GB.) If you like, you can give the container an IP address different from that used on the original system; in that case you might have to adjust a few other files in the container (e.g. Apache configuration, etc., depending on what is installed in the container). If you use the same IP address, don't forget to shut down the original system before you power on the OpenVZ container! These are the basic settings. You can, of course, also change the other settings with the vzctl command. Before we start the OpenVZ container, we have to do a few OpenVZ-specific changes to it: sed -i -e '/getty/d' /vz/private/211/etc/inittab Copyright 2009 All Rights Reserved. HowtoForge Page 3 of 5

rm -f /vz/private/211/etc/mtab ln -s /proc/mounts /vz/private/211/etc/mtab cp /vz/private/211/etc/fstab /vz/private/211/etc/fstab.old grep devpts /vz/private/211/etc/fstab.old > /vz/private/211/etc/fstab mkdir /vz/private/211/dev mknod --mode 666 /vz/private/211/dev/ptmx c 5 2 mkdir /vz/private/211/dev/pts cp -a /dev/ttyp* /dev/ptyp* /vz/private/211/dev/ rm -f /vz/private/211/dev/null mknod --mode 666 /vz/private/211/dev/null c 1 3 mknod --mode 444 /vz/private/211/dev/urandom c 1 9 mkdir /vz/private/211/proc cat /dev/null > /vz/private/211/etc/network/interfaces That's it, you can now start the new OpenVZ container (don't forget to shut down the old system first if both are using the same IP!)... vzctl start 211 Copyright 2009 All Rights Reserved. HowtoForge Page 4 of 5

... and set a password: vzctl exec 211 passwd 3 Links - OpenVZ: http://wiki.openvz.org/main_page - Debian: http://www.debian.org Copyright 2009 All Rights Reserved. HowtoForge Page 5 of 5