カスタム VM 名の設定
ESC で VM 名を自動生成しない場合は、VM 名をカスタマイズできます。VM 名をカスタマイズするには、展開データモデルの VM グループセクションで vim_vm_name
を指定します。vim_vm_name
が指定されていない場合、ESC によって VM 名が自動生成されます。
カスタム名の指定時に、VM グループに複数の VM が存在する場合、出力のカスタム VM 名に「_<index>」が追加されます。たとえば、グループ内の最初の VM は vim_vm_name
で指定された名前になり、2 番目以降の VM のカスタム名にはインデックス「_1」、「_ 2」が追加されます。ABC として指定されたカスタム名の場合、出力の VM 名は、VMname、VMname_1、VMname_2 などと表示されます。VM
グループ内の VM が 1 つだけの場合、カスタム VM 名に「_<index>」は追加されません。
単一の展開に複数の VM グループを含めることができます。また、必要に応じて、個々の VM グループで異なる vim_vm_name
値を指定できます。たとえば、展開に 2 つの VM グループがある場合、最初のグループで vim_vm_name
を指定すると、すべての VM の名前が前述のように生成されます。2 番目の VM グループでは vim_vm_name
を指定しないため、このグループから作成されるすべての VM 名は自動生成されます。
カスタム VM 名は、1 つの OpenStack 展開における展開およびテナント内で一意である必要があります。つまり、カスタム VM 名は異なるテナント間で複製できます。また、異なる展開用であれば、同じテナント内でも複製できます。VMware 展開の場合、カスタム VM 名は vCenter サーバ全体で一意である必要があります。つまり、重複する VM 名は許可されません。
(注) |
カスタム名には最大 63 文字を使用できます。VM 名には特殊文字は使用できず、英数字と「_」および「-」のみ使用できます。 |
<esc_datamodel xmlns="http://www.cisco.com/esc/esc"> <tenants><tenant>
<name>Admin</name>
<deployments>
<deployment>
<deployment_name>NwDepModel_nosvc</deployment_name>
<vm_group>
<name>CIRROS</name>
<image>Automation-Cirros-Image</image>
<flavor>Automation-Cirros-Flavor</flavor>
<vim_vm_name>VMname</vim_vm_name>
<scaling>
<min_active>1</min_active>
<max_active>2</max_active>
<elastic>true</elastic>
</scaling>
</vm_group>
(注) |
|
次に、カスタム VM 名を含む出力例を示します。展開時に vim_vm_name を設定した場合は、同じ値が出力に表示されます。展開時にこの値を設定しなかった場合は、ESC によって VM 名が自動生成されます。
-
次に、カスタム VM 名を追加した後に esc_nc_cli スクリプトを使用して取得した運用データの出力例を示します。<vmname> という新しい要素が vm_group 要素の下に表示されます。<status_message> フィールドの値も、カスタム VM 名を反映するために更新されます。 <?xml version="1.0" encoding="UTF-8"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <data> <esc_datamodel xmlns="http://www.cisco.com/esc/esc"> <opdata> <tenants> <tenant> <name>xyzzy</name> <deployments> <deployment_name>my-deployment-123</deployment_name> <deployment_id>78d48bf8-5f67-45fc-8d92-5ad4676yf57</deployment_id> <vm_group> <name>Grp1</name> <vm_instance> <vm_id>df108144-ec4f-4d66-a62f-98096ecddef0</vm_id> <name>VMname</name> </vm_group>
-
次に、REST API を使用して取得した出力の運用データの例を示します。 GET http://localhost:8080/ESCManager/v0/deployments/example-deployment-123 | xmllint --format - <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <deployment xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <datacenter> <default>false</default> </datacenter> <deployment_details> <host_uuid>8623f1476302a5815608dbd4c2f836c570e8c74cbfbaff41c78564b1</host_uuid> <host_name>my-server</host_name> <vm_uuid>e7e5a905-e0c7-4652-ae1f-23a409a58219</vm_uuid> <interfaces> <interface> </interface> </interfaces> <vm_group_name>Grp1</vm_group_name> <vm_name>VMname_1</vm_name><-- ##### custom vm name, single VM in the VM group, so no appended "_<index>" --> <vm_state_machine_state>VM_ALIVE_STATE</vm_state_machine_state> </deployment_details> </deployment>