Parallels Virtuozzo Containers Best Practices Alec Istomin, Sr. Sales Engineer
Agenda Optimize your Virtuozzo infrastructure New Virtuozzo Server Provisioning Best Practices Take Control of Resources Utilization Q & A
Optimize the Virtuozzo infrastructure Configure Virtuozzo and PIM defaults Create Container Samples: Resources (SLM), Network Settings, Templates Create Virtual Networks Create IP Address Pool Create Infrastructure and Logical Folders Connect to your AD Domain Create and Assign Security Roles Configure Global Backup Defaults:Storage Location, Type (Incremental) Schedule Periodic Backups
Optimize the Virtuozzo infrastructure Linux: Maintain Local Repositories for EZ Templates Create Linux Distributions Mirrors: createrepo, vzcreaterepo, vzpkgproxy, vzrhnproxy Create Custom Packages Repository: createrepo Keep Local Repositories up2date: rsync, createrepo Configure EZ Templates: /etc/vztt/url.map, repositories, mirrorlist Configure yum on Virtuozzo Hosts Maintain Local Virtuozzo updates repository Create in a Container: vzup2date-mirror, VUS (Windows) Keep up2date Manual Approval is Possible: <ApproveSystemUpdate> (Linux),VUS Manager GUI Configure on Virtuozzo Hosts: vzup2date.conf (Linux), registry or GUI
Optimize the Virtuozzo infrastructure Enable scripting across environment Linux: Use scripting over ssh: .ssh/authorized_keys2 Windows: Use psexec.exe from Sysinternals Maintain the text file with Server IP addresses Run scripts on EVERY Server from a single location Example: one-liner to install Virtuozzo updates on ALL servers: for i in `cat /root/servers.txt `; do ssh $i "hostname;vzup2date -m batch install --self-update --loader-autoconfig"; done for /F "usebackq" %i in (`cmd /c "more servers.txt"`) do psexec \\%i cmd /c "hostname &vzupdate /unattended"
New Virtuozzo Server Provisioning Best Practices Unattended Virtuozzo Installation ./install -a -o --skip-reboot -k smp --lic-key XXXXXX-YYYYYY-XXXXXX-YYYYYY-XXXXXX virtuozzo4.0_x64.exe /L"1033" /V" VZAUTOINSTALL=1 VZ=D:\vz /qr /lv C:\virtuozzo-install.log" Unattended Virtuozzo Updates Installation Configure Virtuozzo to use Local Virtuozzo updates repository vzup2date -m batch install --self-update --loader-autoconfig vzupdate.exe /unattended
New Virtuozzo Server Provisioning Best Practices Scripting Virtuozzo Post Configuration Install Virtuozzo license: vzlicload –p XXXX-YYYY-XXXX-YYYY-XXXX Virtual networks configuration: vznetcfg Configure container backup defaults, ie location: vzabackup --set-folder /vz/backups/ localhost Linux Configure EZ Templates to use Local packages repository: /etc/vztt/url.map Copy Templates metadata from an existing ‘Master’ Server: tar cfpP - /vz/template/*/*/*/config | (ssh newserver.com tar xfpv - -C /) Cache Templates to ensure that repositories are configured properly: vzpkg create cache Windows Copy and Deploy cached Templates net use z: \\masterserver.com\d$\vz\templates\__cache copy /y "z:\*.efd" "%VZROOT%\templates\__cache" for /F "usebackq tokens=1" %i in (`cmd /c "vzpkgls"`) do vzpkgdeploy -i %i 2>nul
Take Control of Resources Utilization Monitor your Hardware, Learn Your Peaks and Bottlenecks PIM - Parallels Infrastructure Manager, will be renamed to PVA (Parallels Virtualization Automation) perfmon: Virtuozzo object in Windows Performance Counters vmstat vzstat vzslmutilization.sh /proc/user_beancounters http://cacti.net/ Is it CPU, Disk, Network or Memory ?
Take Control of Resources Utilization Start from bird’s eye view in PIM
Take Control of Resources Utilization Inspect a Physical server with high utilization vztop; vzps axfw -E; vzstat; vmstat; vzslmutilization.sh taskmgr.exe; perfmon.exe vzlist -o all Inspect an Abusing Container vzps axfw –E CTID Analyze Processes inside Container strace; ltrace; lsof Sysinternals: procexp.exe; handle.exe Can you tell if it’s an Application Malfunction?
Take Control of Resources Utilization Tune Virtuozzo Resource Parameters CPU CPUUNITS CPULIMIT CPUS Disk IOPRIO Network Shaping Tune the Application Move (temporary?) to Faster Hardware
Q & A Thank You!