VMware vCenter のアフィニティルールとアンチアフィニティルール
VMware vCenter のアフィニティルールとアンチアフィニティルールについて例を挙げて説明します。これらのルールは、クラスタおよびターゲットホスト用に作成されます。
すべての VMware vCenter 展開には、常にゾーンホスト配置ポリシーが必要です。ゾーンホストでは、クラスタまたはホストのいずれかであるターゲット VM グループを定義します。
グループ内アフィニティポリシー
同じ VM グループを持つ VNF は、同じホストに展開できます。
展開中に、ESC はアフィニティのアンカー VM として最初の VM を展開します。同じアフィニティルールに従う他のすべての VM は、アンカー VM と同じホストに展開されます。アンカー VM の展開は、リソース使用率の最適化に役立ちます。
グループ内アフィニティポリシーの例:
…
<vm_group>
<name>vm-gp</name>
…
<placement>
<type>zone_host</type>
<enforcement>strict</enforcement>
<zone>cluster1</zone>
</placement>
<placement>
<type>affinity</type>
<enforcement>strict</enforcement>
</placement>
…
(注) |
strict 属性のみが適用されます。 |
(注) |
ホスト配置ポリシーを備えたアフィニティおよびアンチアフィニティポリシーが正しくないため、展開が失敗する可能性があります。ホスト配置を単独で(VM グループ内のアフィニティおよびアンチアフィニティ配置ポリシーなし)使用して、グループ内アフィニティを実現できます。 |
グループ内アンチアフィニティ
同じ VM グループを持つ VNF は、異なるホストに展開できます。展開時に、ESC は同じ VM グループを使用して VNF を次々に展開します。各 VNF 展開の最後に、ESC はそのホストをリストに記録します。各 VNF 展開の開始時に、ESC はリストに含まれていないコンピューティングホストに VNF を展開します。使用可能なすべてのコンピューティングホストがリストに含まれている場合、ESC による展開全体が失敗します。
グループ内アンチアフィニティポリシーの例:
…
<vm_group>
<name>vm-gp</name>
…
<placement>
<type>zone_host</type>
<enforcement>strict</enforcement>
<zone>cluster1</zone>
</placement>
<placement>
<type>anti_affinity</type>
<enforcement>strict</enforcement>
</placement>
クラスタの配置
VM グループ内のすべての VM をクラスタに展開できます。たとえば、VM グループ CSR-gp1 内のすべての VM をクラスタ dc-cluster2 に展開できます。
(注) |
VMware vCenter クラスタは、管理者が作成する必要があります。 |
クラスタ配置の例:
<name>CSR-gp1</name>
<placement>
<type>zone_host</type>
<enforcement>strict</enforcement>
<zone>dc-cluster2</zone>
</placement>
ホストの配置
VM グループ内のすべての VMS をホストに展開できます。たとえば、VM グループ CSR-gp1 のすべての VM がホスト 10.2.0.2 に展開されます。
<name>CSR-gp1</name>
<placement>
<type>zone_host</type>
<enforcement>strict</enforcement>
<host>10.2.0.2</host>
</placement>
グループ間アフィニティポリシー
異なる VM グループの VM を同じホストに展開できます。たとえば、VM グループ ASA-gp1 内のすべての VM を、VM グループ CSR-gp1 内の VM と同じホストに展開できます。
展開中、ESC は最初の VM をアンカー VM として展開します。同じアフィニティルールに従う他のすべての VM は、アンカー VM と同じホストに展開されます。
(注) |
グループ間アフィニティルールが単一のクラスタ内に適用されるようにするには、展開内のすべての VM グループが同じクラスタ(ESC data_model の <zone>)に指定されていることを確認します。 |
グループ間アフィニティポリシーの例:
<deployment>
<deployment>
<name>test-affinity-2groups</name>
<policies>
<placement>
<target_vm_group_ref>CSR-gp1</target_vm_group_ref>
<type>affinity</type>
<vm_group_ref>CSR-gp2</vm_group_ref>
<vm_group_ref>ASA-gp1</vm_group_ref>
<enforcement>strict</enforcement>
</placement>
</policies>
グループ間アンチアフィニティポリシー
同じ導入環境にあるが VM グループが異なる VNF は、異なるホストに明示的に展開できます。たとえば、バックアップ VNF や高可用性 VNF などです。複数の VM グループは、vm_group_ref タグを追加し、VM グループ名を値として 指定することで、このポリシーに従うことができます。
(注) |
placement タグの下で使用できる <target_vm_group_ref> タグ、type タグ、および enforcement タグは 1 つだけです。ホストまたはゾーンは指定できません。複数の <vm_group_ref> タグを使用できますが、アンチアフィニティポリシーは、 <vm_group_ref> およびそれらの <target_vm_group_ref> の間にのみ適用されます。つまり、許容できる <target_vm_group_ref> からそれぞれが別のホストに展開されている限り、2 つ以上の <vm_group_ref> を同じホストに展開できます。 |
グループ間アンチアフィニティポリシーの例:
<deployments>
<deployment>
<name>intergroup-anti_affinity-dep</name>
<policies>
<placement>
<target_vm_group_ref>affinity-test-gp1</target_vm_group_ref>
<type>anti_affinity</type>
<vm_group_ref>affinity-test-gp2</vm_group_ref>
<enforcement>strict</enforcement>
</placement>
</policies>
…
マルチ VIM 展開では、配置ポリシーの VM グループは同じ VIM に属している必要があります。つまり、VIM コネクタは(VM グループのロケータタグの vim_id 属性で指定される)VM グループで同一である必要があります。VM グループ間のアフィニティポリシーおよびアンチアフィニティポリシーが異なる VIM 上にある場合、ESC は展開を拒否します。複数展開での VM の展開の詳細については、「複数の OpenStack VIM への VNF の展開」を参照してください。
配置グループタグがポリシーの下に追加されます。それぞれの <placement_group> には次が含まれます。
-
name:展開ごとに一意の名前。
-
type:アフィニティまたはアンチアフィニティ
-
enforcement:strict
-
vm_group:各 vm_group の内容は、同じ展開でリストされた VM グループ名である必要があります。
配置グループタグは、配置ポリシー内に配置されます。配置ポリシーは、ターゲット VM グループと VM グループメンバー間の関係を記述します。配置グループポリシーは、すべての VM グループメンバー間の相互関係を記述します。配置グループポリシーは、ターゲット VM グループには適用されません。
次に、データモデルを示します。
<policies>
<placement_group>
<name>placement-affinity-1</name>
<type>affinity</type>
<enforcement>strict</enforcement>
<vm_group>t1g1</vm_group>
<vm_group>t1g2</vm_group>
<vm_group>t1g7</vm_group>
</placement_group>
<placement_group>
<name>placement-affinity-2</name>
<type>affinity</type>
<enforcement>strict</enforcement>
<vm_group>t1g3</vm_group>
<vm_group>t1g4</vm_group>
</placement_group>
<placement_group>
<name>placement-affinity-3</name>
<type>affinity</type>
<enforcement>strict</enforcement>
<vm_group>t1g5</vm_group>
<vm_group>t1g6</vm_group>
</placement_group>
<placement_group>
<name>placement-anti-affinity-1</name>
<type>anti_affinity</type>
<enforcement>strict</enforcement>
<vm_group>t1g1</vm_group>
<vm_group>t1g3</vm_group>
<vm_group>t1g5</vm_group>
</placement_group>
</policies>
(注) |
ポリシーの下の新しい配置グループタグでは、<target_vm_group_ref> および <vm_group_ref> が <vm_group> に置き換えられます。参照ベースのアフィニティタグとアンチアフィニティタグは廃止されました。 配置グループポリシーは、グループ間アフィニティおよびアンチアフィニティポリシーにのみ適用されます。 グループ間アフィニティおよびアンチアフィニティポリシーでは、配置タグと配置グループタグの両方を同時に使用することはできません。 配置グループ名タグは、配置グループポリシーごとに一意である必要があります。 |
制限事項
アフィニティルールとアンチアフィニティルールが VMware vCenter に適用される場合の制限は次のとおりです。
-
VMware vCenter で定義されたすべてのアフィニティルールは、クラスタに実装されます。
-
DPM、HA、および vMotion はオフにする必要があります。
-
VM の展開とリカバリは ESC によって管理されます。
-
DRS がオンになっている場合は、手動モードに設定する必要があります。
-
DRS 展開を活用するには、共有ストレージが必要です。
-
<enforcement> タグでサポートされる値は「strict」にする必要があります。
-
<zone_host> を VM グループに使用する必要があります。