NTNX>日記

個人的な趣味による Nutanix Community Edition 日記。Japanese のみですみません。

Nutanix Cmdlets を PowerShell で読み込む。(Add-PSSnapin)

Nutanix Cmdlets は、デスクトップなどのショートカットアイコンから起動できます。

f:id:gowatana:20161015032705p:plain

ショートカットは、Nutanix Cmdlets のインストール時に作成されるものです。

ある日気が付いたら、Windows 10 にインストールしていた Nutanix Cmdlets が、デスクトップのショートカットから起動できなくなりました。

ショートカットの Run.bat を実行すると・・・

f:id:gowatana:20161015032852p:plain

Run.bat から読み込む PowerShell の Snapin を読み込んでみました。

 

Nutanix Cmdlets の Snapin を読み込む

今回の PowerShell のバージョンです。

PS C:\> Get-Host | select Version | fl


Version : 5.1.14393.206

PowerShell を起動して、Snapin 読み込む。

PS C:\> Add-PSSnapin NutanixCmdletsPSSnapin
PS C:\> 

読み込まれました。

PS C:\> Get-PSSnapin -Name Nutanix*


Name        : NutanixCmdletsPSSnapin
PSVersion   : 5.0
Description : This is a custom PowerShell snap-inthat loads Nutanix Cmdlets.



Nutanix Cmdlets の実行確認

NTNX 系のコマンドレットが使用可能になるので、Nutanix Cluster(今回は 1-Node なので CVM のアドレス)に接続します。接続確認では「Y」。

PS C:\> Connect-NTNXCluster -Server <CVM のアドレス> -AcceptInvalidSSLCerts -UserName admin

コマンド パイプライン位置 1 のコマンドレット Connect-NTNXCluster
次のパラメーターに値を指定してください:
(ヘルプを表示するには、「!?」と入力してください。)
Password: ************
[Warning]: Cluster version[2016.09.23] and Cmdlets version[4.7] do not match. This might cause some cmdlets to not function correctly. Do you still want to continue [Y/N]?: Y


Server                : <CVM のアドレス>
UserName              : admin
Password              : System.Security.SecureString
AcceptInvalidSSLCerts : True
ForcedConnection      : False
ParameterSetName      : __AllParameterSets
MyInvocation          : System.Management.Automation.InvocationInfo
PagingParameters      :
InvokeCommand         : System.Management.Automation.CommandInvocationIntrinsics
Host                  : System.Management.Automation.Internal.Host.InternalHost
SessionState          : System.Management.Automation.SessionState
Events                : System.Management.Automation.PSLocalEventManager
JobRepository         : System.Management.Automation.JobRepository
JobManager            : System.Management.Automation.JobManager
InvokeProvider        : System.Management.Automation.ProviderIntrinsics
Stopping              : False
CommandRuntime        : Connect-NTNXCluster
CurrentPSTransaction  :
CommandOrigin         : Runspace
lastAccessTimestamp   : 2016/10/15 3:50:12
IsConnected           : True



PS C:\>

Nutanix Cluster の情報の一部を取得してみます。
今回は Nutanix CE なので Acropolis Hypervisor (KVM) で、1 Node 構成です。

PS C:\> Get-NTNXCluster | select version,hypervisorTypes,numNodes | fl


version         : 2016.09.23
hypervisorTypes : {kKvm}
numNodes        : 1


Acropolis Hypervisor の情報の一部を取得してみます。

PS C:\> Get-NTNXHost | select name,blockModelName,hypervisorFullName | fl


name               : NTNX-b3b7a3a8-A
blockModelName     : CommunityEdition
hypervisorFullName : Nutanix 20150513

以上。

©2023 gowatana
クリエイティブ・コモンズ・ライセンスこの 作品 は クリエイティブ・コモンズ 表示 4.0 国際 ライセンスの下に提供されています。