この製品のマニュアルセットは、偏向のない言語を使用するように配慮されています。このマニュアルセットでの偏向のない言語とは、年齢、障害、性別、人種的アイデンティティ、民族的アイデンティティ、性的指向、社会経済的地位、およびインターセクショナリティに基づく差別を意味しない言語として定義されています。製品ソフトウェアのユーザーインターフェイスにハードコードされている言語、RFP のドキュメントに基づいて使用されている言語、または参照されているサードパーティ製品で使用されている言語によりドキュメントに例外が存在する場合があります。シスコのインクルーシブランゲージに対する取り組みの詳細は、こちらをご覧ください。
このドキュメントは、米国シスコ発行ドキュメントの参考和訳です。リンク情報につきましては、日本語版掲載時点で、英語版にアップデートがあり、リンク先のページが移動/変更されている場合がありますことをご了承ください。あくまでも参考和訳となりますので、正式な内容については米国サイトのドキュメントを参照ください。
この章は、次の項で構成されています。
UCS Director タスク ライブラリから利用可能な VM コマンドの実行タスクを使用すれば、ゲスト VM でコマンドを実行することもできます。VM コマンドの実行により、PowerShell またはコマンド プロンプトでコマンドを実行してゲスト OS 操作できます。
PowerShell コマンドを実行するには、VM コマンドの実行タスクの [コマンドパス(Command Path)] フィールドに以下の内容を入力します。
コマンド プロンプトでコマンドを実行するには、VM コマンドの実行タスクに以下の内容を入力します。
(注) | VM コマンドの実行タスクは、将来のリリースで廃止されます。同じ機能がゲスト操作タスクで利用可能です。 ゲスト操作タスクを参照してください。 |
次の例に、VIX スクリプトの実行タスクを使用して VM で Linux または Windows コマンドを実行する方法を示します。
この例では、VM コマンドの実行タスクを使用して、PowerShell で Windows コマンドを実行します。PowerShell でコマンドを実行するには、PowerShell とコマンドのパスを入力します。
UCS Director アプライアンスで利用可能な VM コマンドの実行タスクに、以下の情報を入力します。
Windows コマンドを実行する VM を選択します。
VM の管理者クレデンシャルを入力します。
[コマンド パス(Command Path)] フィールドに、PowerShell とコマンドのパスを入力します。
C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe Get-NetAdapter | Where-Object {$_.Status -eq ‘UP’} | Set-DNSClientServerAddress -ServerAddresses ('${DNS1}','${DNS2}')
(注) | ここで DNS1 と DNS2 は定義済みのワークフロー入力です。 |
タスクの実行後、SR ログに以下の情報が表示されます。
Service request ID: 734 Workflow Inputs: - DNS1 - DNS2 Apr 26, 2016 12:06:00 UTC Request Submitted Apr 26, 2016 12:06:03 UTC Executing workflow item number 1 Apr 26, 2016 12:06:03 UTC Completed workflow item number 0, with status completed Apr 26, 2016 12:06:09 UTC Executing workflow item number 2 Apr 26, 2016 12:06:00 UTC Trigger context executeWorkflowStep called Apr 26, 2016 12:06:09 UTC Executing custom action Execute_VM_Command(Execute VM Command) Apr 26, 2016 12:06:09 UTC Executing custom action Execute_VM_Command(Execute VM Command) Apr 26, 2016 12:06:13 UTC Task#1 (Execute_VM_Command(Execute VM Command)) completed successfully in 3 seconds Apr 26, 2016 12:06:13 UTC Input/Output values for Task#1 (Execute_VM_Command(Execute VM Command)): Apr 26, 2016 12:06:13 UTC [Local Input: Select VM = 3312) Apr 26, 2016 12:06:13 UTC [Local Input: Login = administrator] Apr 26, 2016 12:06:13 UTC [Local Input: Password = "masked-value") Apr 26, 2016 12:06:13 UTC [Template Input: Command Path = C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe Get-NetAdapter | Where-Object {$_.Status -eq ‘UP’} | Set-DNSClientServerAddress -ServerAddresses ('${DNS1}','${DNS2}')] Apr 26, 2016 12:06:13 UTC [Resolved Template Input: Command Path = C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe Get-NetAdapter | Where-Object {$_.Status -eq ‘UP’} | Set-DNSClientServerAddress -ServerAddresses ('10.10.10.10','20.20.20.20')] Apr 26, 2016 12:06:13 UTC [Local Input: Command Path = C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe Get-NetAdapter | Where-Object {$_.Status -eq ‘UP’} | Set-DNSClientServerAddress -ServerAddresses ('10.10.10.10','20.20.20.20')] Apr 26, 2016 12:06:13 UTC [Local Input: Command Arguments = ] Apr 26, 2016 12:06:13 UTC Completed workflow item number 1, with status completed Apr 26, 2016 12:06:13 UTC Completed workflow item number 3 Apr 26, 2016 12:06:13 UTC Completed workflow item number 2, with status completed
この例では、VM コマンドの実行タスクを使用して、コマンド プロンプトで Windows コマンドを実行します。コマンド プロンプトでコマンドを実行するには、コマンド パスに cmd.exe のパスを入力します。[コマンド引数(Command Arguments)] フィールドに、コマンドおよびカンマで区切った引数を入力します。
UCS Director アプライアンスで利用可能な VM コマンドの実行タスクに、以下の情報を入力します。
Windows コマンドを実行する VM を選択します。
VM の管理者クレデンシャルを入力します。
[コマンド パス(Command Path)] フィールドに、cmd.exe ファイルのパスを入力します。
C:\\WINDOWS\\system32\\cmd.exe
[コマンド引数(Command Arguments)] フィールドに、コマンドとカンマで区切った引数を入力します。
mkdir C:\\testDir1,C:\\testDir2,C:\\testDir3
タスクの実行後、SR ログに以下の情報が表示されます。
Service request ID: 534 Apr 06, 2016 12:06:00 UTC Request Submitted Apr 06, 2016 12:06:03 UTC Executing workflow item number 1 Apr 06, 2016 12:06:03 UTC Completed workflow item number 0, with status completed Apr 06, 2016 12:06:09 UTC Executing workflow item number 2 Apr 06, 2016 12:06:00 UTC Trigger context executeWorkflowStep called Apr 06, 2016 12:06:09 UTC Executing custom action Execute_VM_Command(Execute VM Command) Apr 06, 2016 12:06:09 UTC Executing custom action Execute_VM_Command(Execute VM Command) Apr 06, 2016 12:06:13 UTC Task#1 (Execute_VM_Command(Execute VM Command)) completed successfully in 3 seconds Apr 06, 2016 12:06:13 UTC Input/Output values for Task#1 (Execute_VM_Command(Execute VM Command)): Apr 06, 2016 12:06:13 UTC [Local Input: Select VM = 3312) Apr 06, 2016 12:06:13 UTC [Local Input: Login = administrator] Apr 06, 2016 12:06:13 UTC [Local Input: Password = "masked-value") Apr 06, 2016 12:06:13 UTC [Local Input: Command Path = C:\\WINDOWS\\system32\\cmd.exe] Apr 06, 2016 12:06:13 UTC [Local Input: Command Arguments = mkdir C:\\testDir1,C:\\testDir2,C:\\testDir3] Apr 06, 2016 12:06:13 UTC Completed workflow item number 1, with status completed Apr 06, 2016 12:06:13 UTC Completed workflow item number 3 Apr 06, 2016 12:06:13 UTC Completed workflow item number 2, with status completed
この例では、VM コマンドの実行タスクを使用して、コマンド プロンプトで Linux コマンドを実行します。
UCS Director アプライアンスで利用可能な VM コマンドの実行タスクに、以下の情報を入力します。
Linux コマンドを実行する VM を選択します。
VM の管理者クレデンシャルを入力します。
[コマンド パス(Command Path)] フィールドに、サンプル Linux コマンドを入力します。
/bin/mkdir
[コマンド引数(Command Arguments)] フィールドに、以下のコマンドを入力します。
/opt/testDirectory
タスクの実行後、SR ログに以下の情報が表示されます。
Service request ID: 445 Apr 06, 2016 12:06:00 UTC Request Submitted Apr 06, 2016 12:06:03 UTC Executing workflow item number 1 Apr 06, 2016 12:06:03 UTC Completed workflow item number 0, with status completed Apr 06, 2016 12:06:09 UTC Executing workflow item number 2 Apr 06, 2016 12:06:00 UTC Trigger context executeWorkflowStep called Apr 06, 2016 12:06:09 UTC Executing custom action Execute_VM_Command(Execute VM Command) Apr 06, 2016 12:06:09 UTC Executing custom action Execute_VM_Command(Execute VM Command) Apr 06, 2016 12:06:13 UTC Task#1 (Execute_VM_Command(Execute VM Command)) completed successfully in 3 seconds Apr 06, 2016 12:06:13 UTC Input/Output values for Task#1 (Execute_VM_Command(Execute VM Command)): Apr 06, 2016 12:06:13 UTC [Local Input: Select VM = 2339) Apr 06, 2016 12:06:13 UTC [Local Input: Login = administrator] Apr 06, 2016 12:06:13 UTC [Local Input: Password = "masked-value") Apr 06, 2016 12:06:13 UTC [Local Input: Command Path = /bin/mkdir] Apr 06, 2016 12:06:13 UTC [Local Input: Command Arguments = mkdir /opt/testDirectory] Apr 06, 2016 12:06:13 UTC Completed workflow item number 1, with status completed Apr 06, 2016 12:06:13 UTC Completed workflow item number 3 Apr 06, 2016 12:06:13 UTC Completed workflow item number 2, with status completed