D-MONA の設定中、2 種類のランタイム動作を表示できます。1 つは一般的な ESC 展開で予想されるすべての動作を表示でき、もう 1 つは D-MONA が提供する機能を示します。
D-MONA のランタイム動作は、展開時に VM に指定されるデイゼロ設定によって制御されます。デイゼロ設定の詳細については、「D-MONA Day 0 設定」を参照してください。
HA アクティブ/スタンバイおよびスタンドアロンの通知 URL を指定する必要があります。ただし、アクティブ/アクティブ HA の場合、URL は展開時に自動生成または計算されます。
D-MONA Day 0 設定
次の例は、D-MONA の SSH VM アクセス設定を示しています。
<configuration>
<dst>--user-data</dst>
<file>file:///opt/cisco/esc/esc-config/dmona/user-data.template</file>
<variable>
<name>vm_credentials</name>
<val>REPLACED_WITH_GENERATED_PWD</val>
</variable>
</configuration>
次の例は、HA アクティブ/スタンバイおよびスタンドアロンの通知 URL を示しています。
<variable>
<name>notification.url</name>
<val>
http(s)://xxx.xx.x.xx:xxxx/ESCManager/dmona/api/events/notif
</val>
</variable>
vm_credentials は、D-MONA への SSH アクセスのために暗号化されたパスワードを管理者に渡します。
次の例は、D-MONA ESC 証明書の設定を示しています。
<configuration>
<dst>/opt/cisco/esc/moan/dmona.crt</dst>
<data>$DMONA_CERT</data>
</configuration>
次の例は、D-MONA アプリケーションのユーザデータ設定を示しています。
<configuration>
<dst/opt/cisco/esc/mona/config/application-dmona.properties</dst>
<file>file:///opt/cisco/esc/esc-config/dmona/application-dmona.template</file>
<variable>
<name>monitoring.agent</name>
<val>true</val>
</variable>
<variable>
<name>monitoring.agent.vim.mapping</name>
<val>true</val>
</variable>
<!—Used to enable Basic Authentication for communication with the D-MONA Application.->
<variable>
<name>security_basic_enabled</name>
<val>true</val>
</variable>
<variable>
<name>security_user_name</name>
<val>REPLACED_WITH_USER_NAME</val>
</variable>
<variable>
<name>security_user_password</name>
<val>REPLACED_WITH_USER_PASSWORD</val>
</variable>
</configuration>
次に、CSP の D-MONA のデイゼロ テンプレート ファイルの例を示します。
展開前に、適切なアクセス権限を持つすべての ESC インスタンスの /var/tmp/ ディレクトリに D-MONA のデイゼロテンプレートをアップロードします。
#cloud-config
users:
- name: admin # The user's login name
gecos: admin # The user name's real name
groups: esc-user # add admin to group esc-user
passwd: $vm_credentials
# The hash -- not the password itself -- of the password you want
# to use for this user. You can generate a safe hash via:
# mkpasswd --method=SHA-512 --rounds=4096
lock-passwd: false # Defaults to true. Lock the password to disable password login
# Set to false if you want to password login
homedir: /home/admin # Optional. Set to the local path you want to use. Defaults to /home/<username>
sudo: ALL=(ALL) ALL # Defaults to none. Set to the sudo string you want to use
ssh_pwauth: True # Defaults to False. Set to True if you want to enable password authentication for sshd.
write_files:
# ESC Configuration
- path: /opt/cisco/esc/esc-config/esc-config.yaml
content: |
resources:
mona:
dmona: true
- path: /etc/sysconfig/network-scripts/ifcfg-eth0
content: |
DEVICE="eth0"
BOOTPROTO="none"
ONBOOT="yes"
TYPE="Ethernet"
USERCTL="yes"
IPADDR="${NICID_0_IP_ADDRESS}"
NETMASK="${NICID_0_NETMASK}"
GATEWAY="${NICID_0_GATEWAY}"
DEFROUTE="yes"
NM_CONTROLLED="no"
IPV6INIT="no"
IPV4_FAILURE_FATAL="yes"
- path: /etc/sysconfig/network-scripts/ifcfg-eth1
content: |
DEVICE="eth1"
BOOTPROTO="none"
ONBOOT="yes"
TYPE="Ethernet"
USERCTL="yes"
IPADDR="${NICID_1_IP_ADDRESS}"
NETMASK="${NICID_1_NETMASK}"
GATEWAY="${NICID_1_GATEWAY}"
DEFROUTE="yes"
NM_CONTROLLED="no"
IPV6INIT="no"
IPV4_FAILURE_FATAL="yes"
runcmd:
- [ cloud-init-per, once, apply_network_config, sh, -c, "systemctl restart network"]
- [ cloud-init-per, once, copy_dmona_config, sh, -c, "cp -RT /media/cdrom/opt/cisco/esc/mona/ /opt/cisco/esc/mona/"]
- [ cloud-init-per, once, esc_service_start, sh, -c, "chkconfig esc_service on && service esc_service start"] # You must include this line