このトピックでは、Windows Server 2019 または 2016 が稼働している 1 台または複数台の仮想マシン (VM) にネットワーク コントローラーを展開するために、Windows PowerShell を使用する方法について説明します。
Important
ネットワーク コントローラー サーバー ロールを物理ホストに展開しないでください。 ネットワーク コントローラーを展開するには、Hyper-V ホスト上にインストールされている Hyper-V 仮想マシン (VM) にネットワーク コントローラー サーバー ロールをインストールする必要があります。 After you have installed Network Controller on VMs on three different Hyper-V hosts, you must enable the Hyper-V hosts for Software Defined Networking (SDN) by adding the hosts to Network Controller using the Windows PowerShell command New-NetworkControllerServer. これにより、SDN Software Load Balancer を機能させることができます。 For more information, see New-NetworkControllerServer.
このトピックは、次のセクションで構成されています。
ネットワーク コントローラー サーバー ロールのインストール
仮想マシン (VM) にネットワーク コントローラー サーバー ロールをインストールするには、次の手順を行います。
Important
ネットワーク コントローラー サーバー ロールを物理ホストに展開しないでください。 ネットワーク コントローラーを展開するには、Hyper-V ホスト上にインストールされている Hyper-V 仮想マシン (VM) にネットワーク コントローラー サーバー ロールをインストールする必要があります。 3 つの異なる Hyper-V ホスト上の VM にネットワーク コントローラーをインストールした後、ホストをネットワーク コントローラーに追加して、ソフトウェアによるネットワーク制御 (SDN) に対して Hyper-V ホストを有効にする必要があります。 これにより、SDN Software Load Balancer を機能させることができます。
Membership in Administrators, or equivalent, is the minimum required to perform this procedure.
Note
Windows PowerShell の代わりにサーバー マネージャーを使用してネットワーク コントローラーをインストールする場合は、「サーバー マネージャーを使用してネットワーク コントローラー サーバー ロールをインストールする」を参照してください。
Windows PowerShell を使用してネットワーク コントローラーをインストールするには、Windows PowerShell プロンプトで次のコマンドを入力して、Enter キーを押します。
Install-WindowsFeature -Name NetworkController -IncludeManagementTools
ネットワーク コントローラーのインストールでは、コンピューターを再起動する必要があります。 そのためには、次のコマンドを入力し、Enter キーを押します。
Restart-Computer
ネットワーク コントローラー クラスターの構成
ネットワーク コントローラー クラスターにより、ネットワーク コントローラー アプリケーションでは高可用性とスケーラビリティが実現します。このアプリケーションは、クラスターの作成後に構成することができ、クラスター上でホストされます。
Note
次のセクションの手順は、ネットワーク コントローラーをインストールした VM 上で直接実行することも、Windows Server 2016 用のリモート サーバー管理ツールを使用して、Windows Server 2016 または Windows 10 が稼働しているリモート コンピューターから実行することもできます。 In addition, membership in Administrators, or equivalent, is the minimum required to perform this procedure. If the computer or VM upon which you installed Network Controller is joined to a domain, your user account must be a member of Domain Users.
ネットワーク コントローラー クラスターを作成するには、ノード オブジェクトを作成し、クラスターを構成します。
ノード オブジェクトを作成する
ネットワーク コントローラー クラスターのメンバーである VM ごとに、ノード オブジェクトを作成する必要があります。
ノード オブジェクトを作成するには、Windows PowerShell のコマンド プロンプトに、次のコマンドを入力して Enter キーを押します。 パラメーターごとに、展開に適した値を確実に追加します。
New-NetworkControllerNodeObject -Name <string> -Server <String> -FaultDomain <string>-RestInterface <string> [-NodeCertificate <X509Certificate2>]
The following table provides descriptions for each parameter of the New-NetworkControllerNodeObject command.
Parameter | Description |
---|---|
Name | The Name parameter specifies the friendly name of the server that you want to add to the cluster |
Server | The Server parameter specifies the host name, Fully Qualified Domain Name (FQDN), or IP address of the server that you want to add to the cluster. ドメインに参加しているコンピューターの場合、FQDN が必要です。 |
FaultDomain | The FaultDomain parameter specifies the failure domain for the server that you are adding to the cluster. このパラメーターは、クラスターに追加するサーバーと同時に障害が発生する可能性があるサーバーを定義します。 この障害は、電源やネットワーク ソースなど、共有の物理的な依存関係が原因と考えられます。 通常、障害ドメインは、これらの共有の依存関係に関連する階層を表します。障害ドメイン ツリーの上位から、同時に障害が発生する可能性の高いサーバーが増えます。 実行時に、ネットワーク コントローラーはクラスター内の障害ドメインを考慮し、ネットワーク コントローラー サービスが別々の障害ドメインに配置されるように分散を試みます。 このプロセスは、1 つの障害ドメインでの障害発生時に、そのサービスの可用性と状態が損なわれないようにするために役立ちます。 障害ドメインは階層形式で指定されます。 次に例を示します。"Fd:/DC1/Rack1/Host1" の場合、DC1 はデータセンター名、Rack1 はラック名、Host1 はノードが配置されているホストの名前です。 |
RestInterface | The RestInterface parameter specifies the name of the interface on the node where the Representational State Transfer (REST) communication is terminated. このネットワーク コントローラー インターフェイスは、ネットワークの管理レイヤーから Northbound API 要求を受信します。 |
NodeCertificate | The NodeCertificate parameter specifies the certificate that Network Controller uses for computer authentication. クラスター内の通信に証明書ベースの認証を使用する場合は証明書が必要です。また、証明書は、ネットワーク コントローラー サービス間のトラフィックの暗号化にも使用されます。 証明書のサブジェクト名は、ノードの DNS 名と同じである必要があります。 |
クラスターを構成する
クラスターを構成するには、Windows PowerShell コマンド プロンプトで次のコマンドを入力して、Enter キーを押します。 パラメーターごとに、展開に適した値を確実に追加します。
Install-NetworkControllerCluster -Node <NetworkControllerNode[]> -ClusterAuthentication <ClusterAuthentication> [-ManagementSecurityGroup <string>][-DiagnosticLogLocation <string>][-LogLocationCredential <PSCredential>] [-CredentialEncryptionCertificate <X509Certificate2>][-Credential <PSCredential>][-CertificateThumbprint <String>] [-UseSSL][-ComputerName <string>][-LogSizeLimitInMBs<UInt32>] [-LogTimeLimitInDays<UInt32>]
The following table provides descriptions for each parameter of the Install-NetworkControllerCluster command.
Parameter | Description |
---|---|
ClusterAuthentication | The ClusterAuthentication parameter specifies the authentication type that is used for securing the communication between nodes and is also used for encryption of traffic between Network Controller services. The supported values are Kerberos, X509 and None. Kerberos 認証はドメイン アカウントを使用し、ネットワーク コントローラー ノードがドメインに参加している場合にのみ使用できます。 X509 ベースの認証を指定する場合は、NetworkControllerNode オブジェクトで証明書を指定する必要があります。 さらに、このコマンドを実行する前に、証明書を手動でプロビジョニングする必要があります。 |
ManagementSecurityGroup | The ManagementSecurityGroup parameter specifies the name of the security group that contains users that are allowed to run the management cmdlets from a remote computer. これは、ClusterAuthentication が Kerberos の場合にのみ適用されます。 ローカル コンピューターのセキュリティ グループではなく、ドメイン セキュリティ グループを指定する必要があります。 |
Node | The Node parameter specifies the list of Network Controller nodes that you created by using the New-NetworkControllerNodeObject command. |
DiagnosticLogLocation | The DiagnosticLogLocation parameter specifies the share location where the diagnostic logs are periodically uploaded. このパラメーターの値を指定しない場合、ログは各ノードでローカルに保存されます。 ログは、ローカルの %systemdrive%\Windows\tracing\SDNDiagnostics フォルダーに保存されます。 クラスター ログは、ローカルの %systemdrive%\ProgramData\Microsoft\Service Fabric\log\Traces フォルダーに保存されます。 |
LogLocationCredential | The LogLocationCredential parameter specifies the credentials that are required for accessing the share location where the logs are stored. |
CredentialEncryptionCertificate | The CredentialEncryptionCertificate parameter specifies the certificate that Network Controller uses to encrypt the credentials that are used to access Network Controller binaries and the LogLocationCredential, if specified. このコマンドを実行する前に、すべてのネットワーク コントローラー ノードで証明書をプロビジョニングする必要があります。また、同じ証明書をすべてのクラスター ノードに登録する必要があります。 運用環境では、このパラメーターを使用してネットワーク コントローラーのバイナリとログを保護することをお勧めします。 このパラメーターを使用しない場合、資格情報はクリア テキストで保存されるため、未承認ユーザーによって悪用される可能性があります。 |
Credential | このパラメーターは、リモート コンピューターからこのコマンドを実行する場合にのみ必要です。 The Credential parameter specifies a user account that has permission to run this command on the target computer. |
CertificateThumbprint | このパラメーターは、リモート コンピューターからこのコマンドを実行する場合にのみ必要です。 The CertificateThumbprint parameter specifies the digital public key certificate (X509) of a user account that has permission to run this command on the target computer. |
UseSSL | このパラメーターは、リモート コンピューターからこのコマンドを実行する場合にのみ必要です。 The UseSSL parameter specifies the Secure Sockets Layer (SSL) protocol that is used to establish a connection to the remote computer. 既定では、SSL は使用されません。 |
ComputerName | The ComputerName parameter specifies the Network Controller node on which this command is run. このパラメーターに値を指定しないと、ローカル コンピューターが既定で使用されます。 |
LogSizeLimitInMBs | このパラメーターでは、ネットワーク コントローラーが保存できる最大ログ サイズ (MB) を指定します。 ログは循環的に保存されます。 DiagnosticLogLocation が指定されている場合、このパラメーターの既定値は 40 GB です。 DiagnosticLogLocation が指定されていない場合、ログはネットワーク コントローラー ノードに保存され、このパラメーターの既定値は 15 GB になります。 |
LogTimeLimitInDays | このパラメーターでは、ログの保存期間の上限 (日数) を指定します。 ログは循環的に保存されます。 このパラメーターの既定値は 3 日です。 |
ネットワーク コントローラー アプリケーションの構成
ネットワーク コントローラー アプリケーションを構成するには、Windows PowerShell コマンド プロンプトで次のコマンドを入力してから、Enter キーを押します。 パラメーターごとに、展開に適した値を確実に追加します。
Install-NetworkController -Node <NetworkControllerNode[]> -ClientAuthentication <ClientAuthentication> [-ClientCertificateThumbprint <string[]>] [-ClientSecurityGroup <string>] -ServerCertificate <X509Certificate2> [-RESTIPAddress <String>] [-RESTName <String>] [-Credential <PSCredential>][-CertificateThumbprint <String> ] [-UseSSL]
The following table provides descriptions for each parameter of the Install-NetworkController command.
Parameter | Description |
---|---|
ClientAuthentication | The ClientAuthentication parameter specifies the authentication type that is used for securing the communication between REST and Network Controller. The supported values are Kerberos, X509 and None. Kerberos 認証はドメイン アカウントを使用し、ネットワーク コントローラー ノードがドメインに参加している場合にのみ使用できます。 X509 ベースの認証を指定する場合は、NetworkControllerNode オブジェクトで証明書を指定する必要があります。 さらに、このコマンドを実行する前に、証明書を手動でプロビジョニングする必要があります。 |
Node | The Node parameter specifies the list of Network Controller nodes that you created by using the New-NetworkControllerNodeObject command. |
ClientCertificateThumbprint | このパラメーターは、ネットワーク コントローラー クライアントに証明書ベースの認証を使用している場合にのみ必要です。 The ClientCertificateThumbprint parameter specifies the thumbprint of the certificate that is enrolled to clients on the Northbound layer. |
ServerCertificate | The ServerCertificate parameter specifies the certificate that Network Controller uses to prove its identity to clients. サーバー証明書は、拡張キー使用法拡張機能にサーバー認証の目的を含める必要があります。また、クライアントによって信頼されている CA によってネットワーク コントローラーに発行される必要があります。 |
RESTIPAddress | You do not need to specify a value for RESTIPAddress with a single node deployment of Network Controller. For multiple-node deployments, the RESTIPAddress parameter specifies the IP address of the REST endpoint in CIDR notation. たとえば、192.168.1.10/24 とします。 The Subject Name value of ServerCertificate must resolve to the value of the RESTIPAddress parameter. すべてのノードが同じサブネット上にある場合は、ネットワーク コントローラーのすべての複数ノードの展開にこのパラメーターを指定する必要があります。 If nodes are on different subnets, you must use the RestName parameter instead of using RESTIPAddress. |
RestName | You do not need to specify a value for RestName with a single node deployment of Network Controller. The only time you must specify a value for RestName is when multiple-node deployments have nodes that are on different subnets. For multiple-node deployments, the RestName parameter specifies the FQDN for the Network Controller cluster. |
ClientSecurityGroup | The ClientSecurityGroup parameter specifies the name of the Active Directory security group whose members are Network Controller clients. This parameter is required only if you use Kerberos authentication for ClientAuthentication. このセキュリティ グループには、REST API へのアクセスに使用するアカウントが含まれている必要があります。また、このコマンドを実行する前に、セキュリティ グループを作成し、メンバーを追加する必要があります。 |
Credential | このパラメーターは、リモート コンピューターからこのコマンドを実行する場合にのみ必要です。 The Credential parameter specifies a user account that has permission to run this command on the target computer. |
CertificateThumbprint | このパラメーターは、リモート コンピューターからこのコマンドを実行する場合にのみ必要です。 The CertificateThumbprint parameter specifies the digital public key certificate (X509) of a user account that has permission to run this command on the target computer. |
UseSSL | このパラメーターは、リモート コンピューターからこのコマンドを実行する場合にのみ必要です。 The UseSSL parameter specifies the Secure Sockets Layer (SSL) protocol that is used to establish a connection to the remote computer. 既定では、SSL は使用されません。 |
ネットワーク コントローラー アプリケーションの構成が完了したら、ネットワーク コントローラーの展開が完了します。
ネットワーク コントローラーの展開の検証
ネットワーク コントローラーの展開を検証するには、ネットワーク コントローラーに資格情報を追加し、その資格情報を取得します。
If you are using Kerberos as the ClientAuthentication mechanism, membership in the ClientSecurityGroup that you created is the minimum required to perform this procedure.
Procedure:
On a client computer, if you are using Kerberos as the ClientAuthentication mechanism, log on with a user account that is a member of your ClientSecurityGroup.
Windows PowerShell を開きます。ネットワーク コントローラーに資格情報を追加するための次のコマンドを入力してから、Enter キーを押します。 パラメーターごとに、展開に適した値を確実に追加します。
$cred=New-Object Microsoft.Windows.Networkcontroller.credentialproperties $cred.type="usernamepassword" $cred.username="admin" $cred.value="abcd" New-NetworkControllerCredential -ConnectionUri https://networkcontroller -Properties $cred -ResourceId cred1
ネットワーク コントローラーに追加した資格情報を取得するには、次のコマンドを入力して、Enter キーを押します。 パラメーターごとに、展開に適した値を確実に追加します。
Get-NetworkControllerCredential -ConnectionUri https://networkcontroller -ResourceId cred1
コマンドの出力を確認します。次の出力例のようになります。
Tags : ResourceRef : /credentials/cred1 CreatedTime : 1/1/0001 12:00:00 AM InstanceId : e16ffe62-a701-4d31-915e-7234d4bc5a18 Etag : W/"1ec59631-607f-4d3e-ac78-94b0822f3a9d" ResourceMetadata : ResourceId : cred1 Properties : Microsoft.Windows.NetworkController.CredentialProperties
Note
When you run the Get-NetworkControllerCredential command, you can assign the output of the command to a variable by using the dot operator to list the properties of the credentials. たとえば、$cred.Properties とします。
ネットワーク コントローラー用の追加の Windows PowerShell コマンド
ネットワーク コントローラーを展開したら、Windows PowerShell コマンドを使用して、展開を管理および変更できます。 展開に加えることができる変更の一部を次に示します。
ネットワーク コントローラー ノード、クラスター、およびアプリケーション設定を変更する
ネットワーク コントローラー クラスターおよびアプリケーションを削除する
ネットワーク コントローラー クラスター ノードを管理する (ノードの追加、削除、有効化、無効化など)
次の表に、これらのタスクを達成するために使用できる Windows PowerShell コマンドの構文を指定します。
Task | Command | Syntax |
---|---|---|
ネットワーク コントローラー クラスターの設定を変更する | Set-NetworkControllerCluster | Set-NetworkControllerCluster [-ManagementSecurityGroup <string>][-Credential <PSCredential>] [-computerName <string>][-CertificateThumbprint <String> ] [-UseSSL] |
ネットワーク コントローラー アプリケーションの設定を変更する | Set-NetworkController | Set-NetworkController [-ClientAuthentication <ClientAuthentication>] [-Credential <PSCredential>] [-ClientCertificateThumbprint <string[]>] [-ClientSecurityGroup <string>] [-ServerCertificate <X509Certificate2>] [-RestIPAddress <String>] [-ComputerName <String>][-CertificateThumbprint <String> ] [-UseSSL] |
ネットワーク コントローラー ノードの設定を変更する | Set-NetworkControllerNode | Set-NetworkControllerNode -Name <string> > [-RestInterface <string>] [-NodeCertificate <X509Certificate2>] [-Credential <PSCredential>] [-ComputerName <string>][-CertificateThumbprint <String> ] [-UseSSL] |
ネットワーク コントローラーの診断設定を変更する | Set-NetworkControllerDiagnostic | Set-NetworkControllerDiagnostic [-LogScope <string>] [-DiagnosticLogLocation <string>] [-LogLocationCredential <PSCredential>] [-UseLocalLogLocation] >] [-LogLevel <loglevel>][-LogSizeLimitInMBs <uint32>] [-LogTimeLimitInDays <uint32>] [-Credential <PSCredential>] [-ComputerName <string>][-CertificateThumbprint <String> ] [-UseSSL] |
ネットワーク コントローラー アプリケーションを削除する | Uninstall-NetworkController | Uninstall-NetworkController [-Credential <PSCredential>][-ComputerName <string>] [-CertificateThumbprint <String> ] [-UseSSL] |
ネットワーク コントローラー クラスターを削除する | Uninstall-NetworkControllerCluster | Uninstall-NetworkControllerCluster [-Credential <PSCredential>][-ComputerName <string>][-CertificateThumbprint <String> ] [-UseSSL] |
ネットワーク コントローラー クラスターにノードを追加する | Add-NetworkControllerNode | Add-NetworkControllerNode -FaultDomain <String> -Name <String> -RestInterface <String> -Server <String> [-CertificateThumbprint <String> ] [-ComputerName <String> ] [-Credential <PSCredential> ] [-Force] [-NodeCertificate <X509Certificate2> ] [-PassThru] [-UseSsl] |
ネットワーク コントローラー クラスター ノードを無効にする | Disable-NetworkControllerNode | Disable-NetworkControllerNode -Name <String> [-CertificateThumbprint <String> ] [-ComputerName <String> ] [-Credential <PSCredential> ] [-PassThru] [-UseSsl] |
ネットワーク コントローラー クラスター ノードを有効にする | Enable-NetworkControllerNode | Enable-NetworkControllerNode -Name <String> [-CertificateThumbprint <String> ] [-ComputerName <String> ] [-Credential <PSCredential> ] [-PassThru] [-UseSsl] |
ネットワーク コントローラー ノードをクラスターから削除する | Remove-NetworkControllerNode | Remove-NetworkControllerNode [-CertificateThumbprint <String> ] [-ComputerName <String> ] [-Credential <PSCredential> ] [-Force] [-Name <String> ] [-PassThru] [-UseSsl] |
Note
ネットワーク コントローラー用の Windows PowerShell コマンドは、TechNet ライブラリのネットワーク コントローラー コマンドレットに関するページに記載されています。
ネットワーク コントローラーのサンプル構成スクリプト
次のサンプル構成スクリプトは、マルチノード ネットワーク コントローラー クラスターを作成し、ネットワーク コントローラー アプリケーションをインストールする方法を示しています。 さらに、サブジェクト名文字列 "networkController.contoso.com" に一致する証明書がローカル コンピューターの証明書ストアから、$cert 変数によって選択されます。
$a = New-NetworkControllerNodeObject -Name Node1 -Server NCNode1.contoso.com -FaultDomain fd:/rack1/host1 -RestInterface Internal
$b = New-NetworkControllerNodeObject -Name Node2 -Server NCNode2.contoso.com -FaultDomain fd:/rack1/host2 -RestInterface Internal
$c = New-NetworkControllerNodeObject -Name Node3 -Server NCNode3.contoso.com -FaultDomain fd:/rack1/host3 -RestInterface Internal
$cert= get-item Cert:\LocalMachine\My | get-ChildItem | where {$_.Subject -imatch "networkController.contoso.com" }
Install-NetworkControllerCluster -Node @($a,$b,$c) -ClusterAuthentication Kerberos -DiagnosticLogLocation \\share\Diagnostics - ManagementSecurityGroup Contoso\NCManagementAdmins -CredentialEncryptionCertificate $cert
Install-NetworkController -Node @($a,$b,$c) -ClientAuthentication Kerberos -ClientSecurityGroup Contoso\NCRESTClients -ServerCertificate $cert -RestIpAddress 10.0.0.1/24
非 Kerberos 展開における展開後の手順
ネットワーク コントローラーの展開で Kerberos を使用していない場合は、証明書を展開する必要があります。
詳細については、「ネットワーク コントローラーの展開後の手順」を参照してください。