2020年11月24日火曜日

Nutanix環境のCLIの使い方 その2 ncli

event_note11月 24, 2020 editBy m.o forumNo comments
■「ncli」と入力するとncliのシェルが起動します。「help」で実行できるコマンドを確認します。


    admin@NTNX-SGH010TH1Q-A-CVM:172.29.161.61:~$ ncli

    Welcome, admin
    You're now connected to 0005b4d4-5120-e489-5297-08f1ea7e5200 (DXCluster) at 127.0.0.1
    
    <ncli> help
    
    Command Formats:
        <ncli> <entity> <action> [ <name> = <value> ]...
        <ncli>  help [detailed=true|false]
        <ncli>  <entity>  help [detailed=true|false]
        <ncli> <entity>  <action>   help [detailed=true|false]
     
    Entities and their corresponding Actions:
    
        data-at-rest-encryption-certificate 
            get-csr-information 
            update-csr-information 
            list-ca-certificates | ls-ca-certificates 
            upload-ca-certificate 
            remove-ca-certificate | rm-ca-certificate 
            download-csrs 
            upload-cvm-certificates 
            replace-cvm-certificate 
            remove-cvm-certificate | rm-cvm-certificate 
    
        rackable-unit | ru 
            list | ls 
            edit | update 
            remove | rm 
    
        datastore 
            list | ls 
            create | add 
            delete | remove | rm 
    
        storagepool | sp 
            list | ls 
            list-stats | ls-stats 
            create | add 
            edit | update 
    
        virtualmachine | vm 
            list | ls 
            list-stats | ls-stats 
            list-snapshots | ls-snaps 
            list-attached-flr-snapshots 
            attach-flr-disk 
            detach-flr-disk 
            list-flr-snapshots | ls-flr-snaps 
            update-fingerprint-on-write 
            update-on-disk-dedup 
    
        storagetier | tier 
            list-supported-types | ls-supported-types 
            list | ls 
            remove | rm 
            get-default-io-priority-order | get-def-io-pri 
            set-default-io-priority-order | set-def-io-pri 
    
        smb-server 
            enable-kerberos 
            disable-kerberos 
            get-kerberos-status 
    
        disk 
            list | ls 
            list-stats | ls-stats 
            list-free | ls-free 
            remove-start | rm-start | delete 
            get-remove-status | get-rm-status 
    
        cluster 
            generate-csr-for-discovered-node 
            remove-start | rm-start | delete 
            get-remove-status | get-rm-status 
            discover-nodes 
            configure-node 
            version 
            get-params | info 
            edit-params | edit-info 
            get-remote-support-status 
            start-remote-support 
            stop-remote-support 
            get-nfs-whitelist 
            add-to-nfs-whitelist 
            remove-from-nfs-whitelist 
            get-ntp-servers 
            add-to-ntp-servers 
            remove-from-ntp-servers 
            get-name-servers 
            add-to-name-servers 
            remove-from-name-servers 
            set-smtp-server 
            get-smtp-server 
            clear-smtp-server 
            send-test-email 
            remove-all-public-keys | rm-all-public-keys 
            list-public-keys | ls-public-keys 
            add-public-key 
            remove-public-key | rm-public-key 
            set-external-ip-address 
            set-timezone 
            clear-external-ip-address 
            get-redundancy-state 
            set-redundancy-state 
            get-domain-fault-tolerance-status | get-dm-ft-stat 
            status 
            join-domain 
            set-dvm-configuration 
            get-ipmi-monitoring-status 
            start-la-jolla-deployment 
            get-la-jolla-azure-info 
            set-ipmi-monitoring-status 
            add-witness 
            edit-cvm-security-params 
            list-witness 
            edit-hypervisor-security-params 
            update-witness 
            get-cvm-security-config 
            remove-witness 
            get-hypervisor-security-config 
            edit-hypervisor-lldp-params 
            get-hypervisor-lldp-config 
    
        events | event 
            list | ls 
            history 
            acknowledge | ack 
    
        container | ctr | storage-container 
            list | ls 
            list-stats | ls-stats 
            create | add 
            edit | update 
            remove | rm 
            get-down-migrate-times | get-dm-times 
            set-down-migrate-times | set-dm-times 
            add-to-nfs-whitelist 
            remove-from-nfs-whitelist 
    
        health-check | check 
            list | ls 
            edit | update 
    
        multicluster 
            get-cluster-state 
            register-to-prism-central 
    
        ssl-certificate 
            import 
            generate 
            change-pfx-file-password 
    
        snapshot | snap 
            list | ls 
            list-stats | ls-stats 
            create | add 
            clone 
            remove | rm 
    
        pulse-config 
            list | ls 
            edit | update 
    
        license 
            apply-license 
            get-license 
            get-allowances 
            generate-cluster-info 
            download-cluster-info 
    
        snmp 
            get-status 
            set-status 
            list-users | ls-users 
            add-user 
            edit-user | update-user 
            remove-user | delete-user 
            list-traps | ls-traps 
            add-trap 
            edit-trap | update-trap 
            remove-trap | delete-trap 
            list-transports | ls-transports 
            add-transport 
            remove-transport | delete-transport 
    
        cloud 
            add-credentials 
            remove-credentials 
            ls-credentials 
            set-default-credentials 
            ls-cvm-images 
            deploy-remote-site 
            ls-cvms 
            ls-subnets 
            clear-all-credentials 
            destroy-remote-site 
    
        vstore 
            list | ls 
            protect 
            unprotect 
    
        volume-group 
            attach-to-vm 
            close | detach-external 
            create 
            delete 
            delete-disk 
            detach-from-vm 
            list | ls 
            list-unprotected 
            open | attach-external 
            update 
            clone-disk 
            create-disk 
            get 
            update-disk 
    
        data-at-rest-encryption 
            get-status 
            password 
            test-configuration 
            rekey-disks 
            get-recent-certificate-test-results 
    
        http-proxy | proxy 
            list | ls 
            add 
            edit | update 
            remove | rm 
            get-whitelist 
            add-to-whitelist 
            delete-from-whitelist 
    
        virtual-disk 
            list | ls 
    
        failover-cluster 
            list 
            create 
            join-nodes 
            remove-node 
    
        vdisk 
            list | ls 
            list-stats | ls-stats 
            create | add 
            edit | update 
            remove | rm 
            snapshot | snap 
            clone 
            list-snapshots | ls-snaps 
            remove-reservation 
    
        alerts | alert 
            list | ls 
            history 
            acknowledge | ack 
            resolve 
            get-alert-config 
            edit-alert-config | update-alert-config 
    
        remote-site | rs 
            create | add 
            list | ls 
            edit | update 
            remove | rm 
            list-snapshots | ls-snaps 
            rm-snapshot | rm-snap 
            retrieve-snapshot 
            add-bandwidth-schedule 
            list-bandwidth-schedules 
            remove-bandwidth-schedule 
            add-network-mapping 
            list-network-mapping 
            remove-network-mapping 
            list-networks 
    
        protection-domain | pd 
            create | add 
            remove | rm 
            list | ls 
            activate 
            rollback-pd 
            migrate 
            list-snapshots | ls-snaps 
            add-minutely-schedule 
            add-hourly-schedule 
            add-daily-schedule 
            add-weekly-schedule 
            add-monthly-schedule 
            remove-from-schedules 
            clear-schedules 
            ls-schedules 
            set-retention-policy 
            clear-retention-policy 
            ls-pending-one-time-snapshots 
            add-one-time-snapshot | create-one-time-snapshot 
            rm-one-time-schedules 
            restore-snapshot 
            protect 
            unprotect 
            rm-snapshot | rm-snap 
            list-replication-status | ls-repl-status 
            retain-snapshot | retain-snap 
            pause-replication | pause-repl 
            resume-replication | resume-repl 
            abort-replication | abort-repl 
            ls-pending-actions 
            metro-avail-enable 
            metro-avail-disable 
            update-failure-handling 
            promote-to-active 
            suspend-schedules 
            resume-schedules 
            status 
    
        managementserver | ms 
            list-management-server-info 
            register 
            unregister 
            list | ls 
            add 
            edit | update 
            remove | rm 
    
        software 
            list | ls 
            download 
            upload 
            remove | rm | delete 
            pause 
            automatic-download 
    
        user 
            list | ls 
            edit | update 
            create | add 
            delete | remove | rm 
            enable 
            disable 
            change-password 
            reset-password 
            grant-user-admin-role 
            revoke-user-admin-role 
            grant-cluster-admin-role 
            revoke-cluster-admin-role 
            show-profile 
            get-logged-in-users | get-logged-in-users 
            get-logged-in-user | get-logged-in-user 
    
        progress-monitor 
            list | ls 
            delete | remove 
    
        authconfig 
            list | ls 
            edit | update 
            remove | rm 
            list-directory | ls-directory 
            create-directory | add-directory 
            edit-directory | update-directory 
            remove-directory | rm-directory 
            list-role-mappings | ls-role-mappings 
            delete-role-mapping 
            add-role-mapping 
            add-to-role-mapping-values 
            remove-from-role-mapping-values 
            get-directory-values-by-type 
            test-ldap-connection 
            update-client-authentication 
            delete-ca-chain-certificate | delete-ca-chain-cert 
            get-client-authentication-config 
            update-service-account 
            set-certificate-revocation 
    
        file-server | fs 
            add-admin-user 
            add-dns 
            add-icap-server 
            add-quota-policy 
            add-snapshot-policy 
            add-virus-scan-policy 
            delete | remove | rm 
            delete-admin-user 
            delete-icap-server 
            delete-infected-files 
            delete-quota-policy 
            delete-share 
            delete-snapshot-policy 
            delete-user 
            delete-virus-scan-policy 
            get 
            get-admin-user 
            get-builtin-groups 
            get-file-servers-usage 
            get-icap-server 
            get-infected-file 
            get-quota-policy 
            get-share | show-share 
            get-snapshot 
            get-virus-scan-policy 
            list | ls 
            list-admin-users 
            list-all-fs-shares 
            list-dns 
            list-icap-servers 
            list-infected-files 
            list-quota-policies 
            list-shares | list-shares 
            list-snapshot-policies 
            list-snapshots 
            list-user 
            protect 
            quarantine-infected-files 
            remove-dns 
            rescan-infected-files 
            reset-infected-files 
            test-icap-connection 
            unquarantine-infected-files 
            update-admin-user 
            update-icap-server 
            update-quota-policy 
            update-share | edit-share 
            update-snapshot-policy 
            update-user 
            update-virus-scan-policy 
            verify-dns 
            activate | activate 
            add-share 
            add-user | add-user 
            add-user-mapping | add-user-mapping 
            clone | clone 
            configure-name-services | configure-name-services 
            create | add 
            edit | update 
            get-principal-type | get-principal-type 
            get-user-mapping | get-user-mapping 
            join-domain | join-domain 
            leave-domain | leave-domain 
            load-balance 
            search-user-mapping 
            update-network 
            update-user-mapping 
            upgrade | upgrade 
    
        key-management-server 
            get 
            list | ls 
            add 
            update 
            remove | rm 
    
        host 
            generate-csr-for-discovered-node 
            remove-start | rm-start | delete 
            get-remove-status | get-rm-status 
            discover-nodes 
            configure-node 
            list | ls 
            list-stats | ls-stats 
            edit | update 
            set-monitoring 
            enable-metadata-store 
            get-certificate-information 
            set-default-vm-vhd-location 
            reset-default-vm-vhd-location 
            join-domain 
    
        nutanix-guest-tools | ngt 
            get 
            list 
            enable 
            disable 
            enable-applications 
            disable-applications 
            mount 
            unmount 
            list-applications 
            delete 
    
        rsyslog-config 
            list | ls 
            list-servers | ls-servers 
            create-server | add-server 
            edit-server | update-server 
            delete-server | remove-server 
            list-modules | ls-modules 
            create-module | add-module 
            delete-module | remove-module 
            get-status 
            set-status 
    
        network | net 
            add-switch-config 
            edit-switch-config 
            delete-switch-config 
            list-switch 
            list-switch-ports 
            get-switch-collector-config 
            edit-switch-collector-config 
            list-host-nics 
            list-snmp-profile 
            list-vm-nics 
            add-snmp-profile 
            list-host-vnics 
            edit-snmp-profile 
            delete-snmp-profile 
    
        task 
            get 
            list | ls 
            wait-for-task 
    
        share 
            -- No Actions Available --
    
        tag 
            -- No Actions Available --
    
    '<name>  = <value>  ' arguments are specific to each operation

■「container list」と入力するとコンテナ の一覧が取得できます。
<ncli>  container list

    Id                        : 0005b4d4-5120-e489-5297-08f1ea7e5200::10
    Uuid                      : f51d6241-622e-4e7c-b7f0-f84177ca3669
    Name                      : default-container-21884572020437
    Storage Pool Id           : 0005b4d4-5120-e489-5297-08f1ea7e5200::9
    Storage Pool Uuid         : 750cfb48-3f81-4727-8758-3683319fa58f
    Free Space (Logical)      : 8.86 TiB (9,736,481,760,870 bytes)
    Used Space (Logical)      : 11 GiB (11,806,736,384 bytes)
    Allowed Max Capacity      : 8.87 TiB (9,748,288,497,254 bytes)
    Used by other Containers  : 63 MiB (66,060,288 bytes)
    Explicit Reservation      : 0 bytes
    Thick Provisioned         : 0 bytes
    Replication Factor        : 2
    Oplog Replication Factor  : 2
    NFS Whitelist Inherited   : true
    Container NFS Whitelist   : 
    VStore Name(s)            : default-container-21884572020437
    Random I/O Pri Order      : SSD-PCIe, SSD-SATA, DAS-SATA
    Sequential I/O Pri Order  : SSD-PCIe, SSD-SATA, DAS-SATA
    Compression               : off
    Fingerprint On Write      : off
    On-Disk Dedup             : off
    Erasure Code              : off
    Software Encryption       : off

    Id                        : 0005b4d4-5120-e489-5297-08f1ea7e5200::11
    Uuid                      : 8c61fbdd-2a3d-44b2-af9c-509d0d8a979c
    Name                      : NutanixManagementShare
    Storage Pool Id           : 0005b4d4-5120-e489-5297-08f1ea7e5200::9
    Storage Pool Uuid         : 750cfb48-3f81-4727-8758-3683319fa58f
    Free Space (Logical)      : 8.86 TiB (9,736,481,760,870 bytes)
    Used Space (Logical)      : 63 MiB (66,060,288 bytes)
    Allowed Max Capacity      : 8.86 TiB (9,736,547,821,158 bytes)
    Used by other Containers  : 11 GiB (11,806,736,384 bytes)
    Explicit Reservation      : 0 bytes
    Thick Provisioned         : 0 bytes
    Replication Factor        : 2
    Oplog Replication Factor  : 2
    NFS Whitelist Inherited   : true
    Container NFS Whitelist   : 
    VStore Name(s)            : NutanixManagementShare
    Random I/O Pri Order      : SSD-PCIe, SSD-SATA, DAS-SATA
    Sequential I/O Pri Order  : SSD-PCIe, SSD-SATA, DAS-SATA
    Compression               : on
    Fingerprint On Write      : off
    On-Disk Dedup             : off
    Erasure Code              : off
    Software Encryption       : off

    Id                        : 0005b4d4-5120-e489-5297-08f1ea7e5200::625
    Uuid                      : 2c47416f-aa7a-4535-8586-0556556888fc
    Name                      : SelfServiceContainer
    Storage Pool Id           : 0005b4d4-5120-e489-5297-08f1ea7e5200::9
    Storage Pool Uuid         : 750cfb48-3f81-4727-8758-3683319fa58f
    Free Space (Logical)      : 8.86 TiB (9,736,481,760,870 bytes)
    Used Space (Logical)      : 0 bytes
    Allowed Max Capacity      : 8.86 TiB (9,736,481,760,870 bytes)
    Used by other Containers  : 11.06 GiB (11,872,796,672 bytes)
    Explicit Reservation      : 0 bytes
    Thick Provisioned         : 0 bytes
    Replication Factor        : 2
    Oplog Replication Factor  : 2
    NFS Whitelist Inherited   : true
    Container NFS Whitelist   : 
    VStore Name(s)            : SelfServiceContainer
    Random I/O Pri Order      : SSD-PCIe, SSD-SATA, DAS-SATA
    Sequential I/O Pri Order  : SSD-PCIe, SSD-SATA, DAS-SATA
    Compression               : off
    Fingerprint On Write      : off
    On-Disk Dedup             : off
    Erasure Code              : off
    Software Encryption       : off

 

■CVMから直接実行することも可能です。「ncli container list」と入力します。
※タブによるコマンドの補間はできません。
admin@NTNX-SGH010TH1Q-A-CVM:172.29.161.61:~$ ncli container list

    Id                        : 0005b4d4-5120-e489-5297-08f1ea7e5200::10
    Uuid                      : f51d6241-622e-4e7c-b7f0-f84177ca3669
    Name                      : default-container-21884572020437
    Storage Pool Id           : 0005b4d4-5120-e489-5297-08f1ea7e5200::9
    Storage Pool Uuid         : 750cfb48-3f81-4727-8758-3683319fa58f
    Free Space (Logical)      : 8.86 TiB (9,736,480,712,294 bytes)
    Used Space (Logical)      : 11 GiB (11,806,736,384 bytes)
    Allowed Max Capacity      : 8.87 TiB (9,748,287,448,678 bytes)
    Used by other Containers  : 64 MiB (67,108,864 bytes)
    Explicit Reservation      : 0 bytes
    Thick Provisioned         : 0 bytes
    Replication Factor        : 2
    Oplog Replication Factor  : 2
    NFS Whitelist Inherited   : true
    Container NFS Whitelist   : 
    VStore Name(s)            : default-container-21884572020437
    Random I/O Pri Order      : SSD-PCIe, SSD-SATA, DAS-SATA
    Sequential I/O Pri Order  : SSD-PCIe, SSD-SATA, DAS-SATA
    Compression               : off
    Fingerprint On Write      : off
    On-Disk Dedup             : off
    Erasure Code              : off
    Software Encryption       : off

    Id                        : 0005b4d4-5120-e489-5297-08f1ea7e5200::11
    Uuid                      : 8c61fbdd-2a3d-44b2-af9c-509d0d8a979c
    Name                      : NutanixManagementShare
    Storage Pool Id           : 0005b4d4-5120-e489-5297-08f1ea7e5200::9
    Storage Pool Uuid         : 750cfb48-3f81-4727-8758-3683319fa58f
    Free Space (Logical)      : 8.86 TiB (9,736,480,712,294 bytes)
    Used Space (Logical)      : 64 MiB (67,108,864 bytes)
    Allowed Max Capacity      : 8.86 TiB (9,736,547,821,158 bytes)
    Used by other Containers  : 11 GiB (11,806,736,384 bytes)
    Explicit Reservation      : 0 bytes
    Thick Provisioned         : 0 bytes
    Replication Factor        : 2
    Oplog Replication Factor  : 2
    NFS Whitelist Inherited   : true
    Container NFS Whitelist   : 
    VStore Name(s)            : NutanixManagementShare
    Random I/O Pri Order      : SSD-PCIe, SSD-SATA, DAS-SATA
    Sequential I/O Pri Order  : SSD-PCIe, SSD-SATA, DAS-SATA
    Compression               : on
    Fingerprint On Write      : off
    On-Disk Dedup             : off
    Erasure Code              : off
    Software Encryption       : off

    Id                        : 0005b4d4-5120-e489-5297-08f1ea7e5200::625
    Uuid                      : 2c47416f-aa7a-4535-8586-0556556888fc
    Name                      : SelfServiceContainer
    Storage Pool Id           : 0005b4d4-5120-e489-5297-08f1ea7e5200::9
    Storage Pool Uuid         : 750cfb48-3f81-4727-8758-3683319fa58f
    Free Space (Logical)      : 8.86 TiB (9,736,480,712,294 bytes)
    Used Space (Logical)      : 0 bytes
    Allowed Max Capacity      : 8.86 TiB (9,736,480,712,294 bytes)
    Used by other Containers  : 11.06 GiB (11,873,845,248 bytes)
    Explicit Reservation      : 0 bytes
    Thick Provisioned         : 0 bytes
    Replication Factor        : 2
    Oplog Replication Factor  : 2
    NFS Whitelist Inherited   : true
    Container NFS Whitelist   : 
    VStore Name(s)            : SelfServiceContainer
    Random I/O Pri Order      : SSD-PCIe, SSD-SATA, DAS-SATA
    Sequential I/O Pri Order  : SSD-PCIe, SSD-SATA, DAS-SATA
    Compression               : off
    Fingerprint On Write      : off
    On-Disk Dedup             : off
    Erasure Code              : off
    Software Encryption       : off

以上、ncliの使い方でした。

0 comments:

コメントを投稿