{"id":1239,"date":"2020-06-02T05:01:49","date_gmt":"2020-06-01T22:01:49","guid":{"rendered":"https:\/\/www.whplus.com\/blog\/?p=1239"},"modified":"2020-05-31T08:10:16","modified_gmt":"2020-05-31T01:10:16","slug":"openvz-cheatsheet","status":"publish","type":"post","link":"https:\/\/www.whplus.com\/blog\/2020\/06\/02\/openvz-cheatsheet.html","title":{"rendered":"OpenVZ Cheatsheet"},"content":{"rendered":"<p><strong>:: VPS Creation Walkthrough ::<\/strong><\/p>\n<p>Create VPS from template:<br \/>\n<code>vzctl create id --ostemplate osname<\/code><\/p>\n<p>Set VPS to boot on host startup:<br \/>\n<code>vzctl set id --onboot yes --save<\/code><\/p>\n<p>Start VPS for further configuration:<br \/>\n<code>vzctl start id<\/code><\/p>\n<p>Set VPS hostname:<br \/>\n<code>vzctl set id --hostname host.domain.com --save<\/code><br \/>\n<!--more--><\/p>\n<p>Set VPS network settings:<br \/>\n<code>vzctl set id --ipadd ipaddress --save<br \/>\nvzctl set id --nameserver ipnameserver --save<\/code><\/p>\n<p>Set password for root user:<br \/>\n<code>vzctl exec id passwd<\/code><\/p>\n<p><strong>:: Advanced VE configuration ::<\/strong><\/p>\n<p>Get VE quota<br \/>\n<code>vzquota stat id<\/code><\/p>\n<p>Double VE disk space quota:<br \/>\n<code>vzctl set id --diskspace $(( soft*2 )):$(( hard*2 ))<\/code><\/p>\n<p>Double VE inode quota:<br \/>\n<code>vzctl set id --diskinodes $(( soft*2 )):$(( hard*2 ))<\/code><\/p>\n<p>Get UBC values:<br \/>\n<code>cat \/proc\/user_beancounters<\/code><\/p>\n<p>Get UBC values for specific VE:<br \/>\n<code>egrep -A23 '^[[:space:]]+${id}:' \/proc\/user_beancounters<\/code><\/p>\n<p>Double UBC values:<br \/>\n<code>vzctl set id --param $(( barrier*2 )):$(( limit*2 ))<\/code><\/p>\n<p>Validate configuration:<br \/>\n<code>vzcfgvalidate \/etc\/vz\/conf\/id.conf<\/code><\/p>\n<p>Go directly into the VE:<br \/>\n<code>vzctl enter id<\/code><\/p>\n<p>Stop the VE:<br \/>\n<code>vzctl stop id<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>:: VPS Creation Walkthrough :: Create VPS from template: vzctl create id &#8211;ostemplate osname Set VPS to boot on host startup: vzctl set id &#8211;onboot yes &#8211;save Start VPS for further configuration: vzctl start id Set VPS hostname: vzctl set id &#8211;hostname host.domain.com &#8211;save<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1239","post","type-post","status-publish","format-standard","hentry","category-tutorial"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/posts\/1239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/comments?post=1239"}],"version-history":[{"count":2,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/posts\/1239\/revisions"}],"predecessor-version":[{"id":1241,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/posts\/1239\/revisions\/1241"}],"wp:attachment":[{"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/media?parent=1239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/categories?post=1239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/tags?post=1239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}