{"id":35091,"date":"2025-09-24T11:33:34","date_gmt":"2025-09-24T04:33:34","guid":{"rendered":"http:\/\/jupitek.maudemo.vip\/index.php\/2025\/09\/24\/tao-placement-group-va-them-cac-linode-hien-co\/"},"modified":"2025-09-24T11:33:34","modified_gmt":"2025-09-24T04:33:34","slug":"tao-placement-group-va-them-cac-linode-hien-co","status":"publish","type":"post","link":"https:\/\/jupitek.maudemo.vip\/index.php\/2025\/09\/24\/tao-placement-group-va-them-cac-linode-hien-co\/","title":{"rendered":"T\u1ea1o\u00a0<em>placement group<\/em>\u00a0v\u00e0 th\u00eam c\u00e1c Linode hi\u1ec7n c\u00f3"},"content":{"rendered":"<p><!DOCTYPE html><br \/>\n<html lang=\"vi\"><br \/>\n<head><br \/>\n  <meta charset=\"utf-8\" \/><br \/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" \/><br \/>\n  <title>T\u1ea1o Placement Group &#038; th\u00eam Linode v\u00e0o nh\u00f3m<\/title><\/p>\n<style>\n    :root{\n      --bg:#ffffff;\n      --card:#f9f9fb;\n      --text:#1a1a1a;\n      --muted:#555;\n      --accent:#0066cc;\n      --border:#ddd;\n      --code:#f5f5f5;\n      --green:#16a34a;\n      --warn:#b45309;\n      --warnbg:#fff7ed;\n      --info:#0b6bcb;\n      --infobg:#e8f2ff;\n    }\n    *{box-sizing:border-box}\n    body{margin:0;background:var(--bg);color:var(--text);\n      font:16px\/1.6 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;}\n    .wrap{max-width:980px;margin:48px auto;padding:0 20px 60px}\n    header h1{font-size:clamp(22px,4vw,34px);margin:0 0 8px}\n    header p{color:var(--muted);margin:0 0 24px}\n    .label{display:inline-block;font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--accent);border:1px solid var(--border);border-radius:999px;padding:4px 10px;background:#fff;margin-bottom:8px}\n    .card{background:var(--card);border:1px solid var(--border);border-radius:14px;padding:24px;margin-bottom:18px}\n    h2{font-size:22px;margin:10px 0 12px}\n    h3{font-size:18px;margin:20px 0 8px;color:var(--accent)}\n    pre{padding:14px 16px;background:var(--code);border:1px solid var(--border);border-radius:12px;overflow:auto;margin:10px 0 0}\n    code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,'Liberation Mono','Courier New',monospace;font-size:14px}\n    ul{margin:0 0 0 20px}\n    .note{border-left:4px solid var(--info);background:var(--infobg);padding:12px 14px;border-radius:8px;margin:12px 0;color:#0b3866}\n    .warn{border-left:4px solid var(--warn);background:var(--warnbg);padding:12px 14px;border-radius:8px;margin:12px 0;color:#5b3a0f}\n    .success{color:var(--black);font-weight:600}\n    a{color:var(--accent);text-decoration:none}\n    a:hover{text-decoration:underline}\n    footer{margin-top:30px;color:var(--muted);font-size:14px}\n    .kbd{display:inline-block;border:1px solid var(--border);border-bottom-width:2px;border-radius:6px;padding:0 6px;background:#f1f1f1}\n  <\/style>\n<p><\/head><br \/>\n<body><\/p>\n<div class=\"wrap\">\n<header>\n<h1>T\u1ea1o <em>placement group<\/em> v\u00e0 th\u00eam c\u00e1c Linode hi\u1ec7n c\u00f3<\/h1>\n<p>K\u1ebft h\u1ee3p c\u00e1c thao t\u00e1c API \u0111\u1ec3 t\u1ea1o placement group m\u1edbi v\u00e0 g\u00e1n Linode v\u00e0o nh\u00f3m.<\/p>\n<\/header>\n<section class=\"card\">\n<h2>Tr\u01b0\u1edbc khi b\u1eaft \u0111\u1ea7u<\/h2>\n<ul>\n<li>Xem l\u1ea1i ph\u1ea7n <strong>Placement groups &amp; compliance<\/strong> \u0111\u1ec3 hi\u1ec3u kh\u00e1i ni\u1ec7m.<\/li>\n<li>Xem <strong>Th\u00f4ng s\u1ed1 k\u1ef9 thu\u1eadt<\/strong> (Technical specifications) \u0111\u1ec3 bi\u1ebft ph\u1ea1m vi h\u1ed7 tr\u1ee3.<\/li>\n<li>T\u00e0i kho\u1ea3n ch\u1ea1y workflow n\u00e0y c\u1ea7n quy\u1ec1n <code>add_linodes<\/code> v\u00e0 quy\u1ec1n <em>read-write<\/em> tr\u00ean c\u00e1c Linode s\u1ebd th\u00eam v\u00e0o nh\u00f3m.<\/li>\n<\/ul>\n<\/section>\n<section class=\"card\">\n<h2>L\u1ea5y th\u00f4ng tin c\u1ea7n thi\u1ebft<\/h2>\n<ol>\n<li>\n<h3>1) Li\u1ec7t k\u00ea v\u00f9ng (List regions)<\/h3>\n<p>L\u01b0u <code>id<\/code> l\u00e0m <span class=\"kbd\">regionId<\/span> v\u00e0 l\u01b0u <code>label<\/code> c\u1ee7a region n\u01a1i c\u00e1c Linode m\u1ee5c ti\u00eau \u0111ang ch\u1ea1y.<\/p>\n<pre><code>{\n  \"data\": [\n    {\n      \"capabilities\": [\n        \"Linodes\",\n        \"NodeBalancers\",\n        \"Block Storage\",\n        \"Object Storage\",\n        \"Placement Groups\",\n        \"Block Storage Encryption\",\n        \"Linode Interfaces\"\n      ],\n      \"country\": \"us\",\n      \"id\": \"us-mia\",        &lt;== L\u01b0u\n      \"label\": \"Miami, FL, USA\", &lt;== L\u01b0u\n      \"placement_group_limits\": {\n        \"maximum_linodes_per_flexible_pg\": 5,\n        \"maximum_linodes_per_pg\": 5,\n        \"maximum_pgs_per_customer\": 10\n      },\n      \"status\": \"ok\"\n    }\n  ]\n}<\/code><\/pre>\n<div class=\"note\">Hi\u1ec7n ch\u1ec9 m\u1ed9t s\u1ed1 region h\u1ed7 tr\u1ee3 Placement Groups.<\/div>\n<\/li>\n<li>\n<h3>2) L\u1ea5y chi ti\u1ebft region (Get a region)<\/h3>\n<p>S\u1eed d\u1ee5ng <span class=\"kbd\">regionId<\/span> \u0111\u00e3 l\u01b0u \u0111\u1ec3 truy v\u1ea5n v\u00e0 l\u01b0u c\u00e1c gi\u1edbi h\u1ea1n d\u00e0nh cho placement group:<\/p>\n<pre><code>\"placement_group_limits\": {\n  \"maximum_linodes_per_pg\": 5,          &lt;== L\u01b0u\n  \"maximum_linodes_per_flexible_pg\": 5, &lt;== L\u01b0u\n  \"maximum_pgs_per_customer\": 10\n}<\/code><\/pre>\n<div class=\"note\">Hi\u1ec7n t\u1ed1i \u0111a <strong>5 Linode<\/strong> trong m\u1ed9t placement group.<\/div>\n<\/li>\n<li>\n<h3>3) L\u1ecdc danh s\u00e1ch Linode theo region<\/h3>\n<p>G\u1ecdi <strong>List Linodes<\/strong> v\u1edbi header l\u1ecdc theo region: <code>X-Filter: 'region: &lt;regionId&gt;'<\/code>. Ch\u1ecdn t\u1ed1i \u0111a theo gi\u1edbi h\u1ea1n \u0111\u00e3 l\u01b0u v\u00e0 l\u01b0u <code>id<\/code> cho t\u1eebng Linode.<\/p>\n<pre><code>{\n  \"data\": [\n    {\n      \"id\": 123, &lt;== L\u01b0u\n      \"hypervisor\": \"kvm\",\n      \"created\": \"2018-01-01T00:01:01\",\n      \"capabilities\": [\"Block Storage Encryption\"],\n      ...\n    }\n  ]\n}<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/section>\n<section class=\"card\">\n<h2>T\u1ea1o placement group<\/h2>\n<p>G\u1ecdi API <strong>Create placement group<\/strong> v\u1edbi c\u00e1c gi\u00e1 tr\u1ecb sau:<\/p>\n<ul>\n<li><code>label<\/code>: t\u00ean d\u1ec5 nh\u1eadn bi\u1ebft cho nh\u00f3m.<\/li>\n<li><code>region<\/code>: <em>id<\/em> c\u1ee7a region \u0111\u00e3 l\u01b0u (v\u00ed d\u1ee5: <code>us-mia<\/code>).<\/li>\n<li><code>placement_group_type<\/code>: ki\u1ec3u s\u1eafp x\u1ebfp. <strong>Hi\u1ec7n ch\u1ec9 h\u1ed7 tr\u1ee3<\/strong> <code>anti_affinity:local<\/code>.<\/li>\n<li><code>placement_group_policy<\/code>: ch\u1ebf \u0111\u1ed9 tu\u00e2n th\u1ee7 khi th\u00eam Linode v\u1ec1 sau: <code>strict<\/code> ho\u1eb7c <code>flexible<\/code>.<\/li>\n<\/ul>\n<div class=\"warn\">Sau khi t\u1ea1o, kh\u00f4ng th\u1ec3 \u0111\u1ed5i <code>placement_group_policy<\/code>.<\/div>\n<pre><code>{\n  \"placement_group_policy\": \"strict\",\n  \"placement_group_type\": \"anti_affinity:local\",\n  \"label\": \"PG_Miami_failover\",\n  \"region\": \"us-mia\"\n}<\/code><\/pre>\n<p>T\u1eeb ph\u1ea3n h\u1ed3i, l\u01b0u <code>id<\/code> l\u00e0m <span class=\"kbd\">placementId<\/span>:<\/p>\n<pre><code>{\n  \"id\": 528, &lt;== L\u01b0u\n  \"is_compliant\": true,\n  \"label\": \"PG_Miami_failover\",\n  \"members\": [\n    { \"is_compliant\": true, \"linode_id\": 123 }\n  ],\n  \"placement_group_policy\": \"strict\",\n  \"placement_group_type\": \"anti-affinity:local\",\n  \"region\": \"us-mia\"\n}<\/code><\/pre>\n<\/section>\n<section class=\"card\">\n<h2>Th\u00eam Linode v\u00e0o nh\u00f3m<\/h2>\n<p>G\u1ecdi API <strong>Assign a placement group<\/strong> v\u1edbi <span class=\"kbd\">placementId<\/span>, \u0111\u01b0a m\u1ea3ng <code>linodes<\/code> l\u00e0 danh s\u00e1ch <em>id<\/em> \u0111\u00e3 l\u01b0u:<\/p>\n<pre><code>{\n  \"linodes\": [123, 456, 789]\n}<\/code><\/pre>\n<p>Ch\u1edd v\u00e0i ph\u00fat r\u1ed3i g\u1ecdi <strong>Get a placement group<\/strong> b\u1eb1ng <span class=\"kbd\">placementId<\/span> \u0111\u1ec3 ki\u1ec3m tra tr\u1ea1ng th\u00e1i:<\/p>\n<pre><code>{\n  \"id\": 528,\n  \"is_compliant\": true,\n  \"label\": \"PG_Miami_failover\",\n  \"members\": [\n    { \"is_compliant\": true, \"linode_id\": 123 }\n  ],\n  \"migrations\": {\n    \"inbound\": [\n      { \"linode_id\": 456 },\n      { \"linode_id\": 789 }\n    ],\n    \"outbound\": []\n  },\n  \"placement_group_policy\": \"strict\",\n  \"placement_group_type\": \"anti-affinity:local\",\n  \"region\": \"us-mia\"\n}<\/code><\/pre>\n<ul>\n<li><strong>members<\/strong>: c\u00e1c Linode \u0111\u00e3 \u0111\u01b0\u1ee3c th\u00eam th\u00e0nh c\u00f4ng (k\u00e8m tr\u1ea1ng th\u00e1i <code>is_compliant<\/code>).<\/li>\n<li><strong>migrations.inbound<\/strong>: c\u00e1c Linode \u0111ang di chuy\u1ec3n v\u00e0o nh\u00f3m; khi xong s\u1ebd xu\u1ea5t hi\u1ec7n trong <code>members<\/code>.<\/li>\n<\/ul>\n<p class=\"success\">Ho\u00e0n t\u1ea5t! B\u1ea1n \u0111\u00e3 t\u1ea1o v\u00e0 g\u00e1n Linode v\u00e0o placement group.<\/p>\n<\/section><\/div>\n<p><!-- Code injected by live-server --><br \/>\n<script>\n\t\/\/ <![CDATA[  <-- For SVG support\n\tif ('WebSocket' in window) {\n\t\t(function () {\n\t\t\tfunction refreshCSS() {\n\t\t\t\tvar sheets = [].slice.call(document.getElementsByTagName(\"link\"));\n\t\t\t\tvar head = document.getElementsByTagName(\"head\")[0];\n\t\t\t\tfor (var i = 0; i < sheets.length; ++i) {\n\t\t\t\t\tvar elem = sheets[i];\n\t\t\t\t\tvar parent = elem.parentElement || head;\n\t\t\t\t\tparent.removeChild(elem);\n\t\t\t\t\tvar rel = elem.rel;\n\t\t\t\t\tif (elem.href &#038;&#038; typeof rel != \"string\" || rel.length == 0 || rel.toLowerCase() == \"stylesheet\") {\n\t\t\t\t\t\tvar url = elem.href.replace(\/(&#038;|\\?)_cacheOverride=\\d+\/, '');\n\t\t\t\t\t\telem.href = url + (url.indexOf('?') >= 0 ? '&' : '?') + '_cacheOverride=' + (new Date().valueOf());\n\t\t\t\t\t}\n\t\t\t\t\tparent.appendChild(elem);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar protocol = window.location.protocol === 'http:' ? 'ws:\/\/' : 'wss:\/\/';\n\t\t\tvar address = protocol + window.location.host + window.location.pathname + '\/ws';\n\t\t\tvar socket = new WebSocket(address);\n\t\t\tsocket.onmessage = function (msg) {\n\t\t\t\tif (msg.data == 'reload') window.location.reload();\n\t\t\t\telse if (msg.data == 'refreshcss') refreshCSS();\n\t\t\t};\n\t\t\tif (sessionStorage && !sessionStorage.getItem('IsThisFirstTime_Log_From_LiveServer')) {\n\t\t\t\tconsole.log('Live reload enabled.');\n\t\t\t\tsessionStorage.setItem('IsThisFirstTime_Log_From_LiveServer', true);\n\t\t\t}\n\t\t})();\n\t}\n\telse {\n\t\tconsole.error('Upgrade your browser. This Browser is NOT supported WebSocket for Live-Reloading.');\n\t}\n\t\/\/ ]]>\n<\/script><br \/>\n<\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>T\u1ea1o Placement Group &#038; th\u00eam Linode v\u00e0o nh\u00f3m T\u1ea1o placement group v\u00e0 th\u00eam c\u00e1c Linode hi\u1ec7n c\u00f3 K\u1ebft h\u1ee3p c\u00e1c thao t\u00e1c API \u0111\u1ec3 t\u1ea1o placement group m\u1edbi v\u00e0 g\u00e1n Linode v\u00e0o nh\u00f3m. Tr\u01b0\u1edbc khi b\u1eaft \u0111\u1ea7u Xem l\u1ea1i ph\u1ea7n Placement groups &amp; compliance \u0111\u1ec3 hi\u1ec3u kh\u00e1i ni\u1ec7m. Xem Th\u00f4ng s\u1ed1 k\u1ef9 thu\u1eadt (Technical specifications)<\/p>\n","protected":false},"author":1,"featured_media":36540,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[121],"tags":[],"class_list":["post-35091","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-placement-groups"],"_links":{"self":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts\/35091","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/comments?post=35091"}],"version-history":[{"count":0,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts\/35091\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/media\/36540"}],"wp:attachment":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/media?parent=35091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/categories?post=35091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/tags?post=35091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}