この製品のマニュアルセットは、偏向のない言語を使用するように配慮されています。このマニュアルセットでの偏向のない言語とは、年齢、障害、性別、人種的アイデンティティ、民族的アイデンティティ、性的指向、社会経済的地位、およびインターセクショナリティに基づく差別を意味しない言語として定義されています。製品ソフトウェアのユーザーインターフェイスにハードコードされている言語、RFP のドキュメントに基づいて使用されている言語、または参照されているサードパーティ製品で使用されている言語によりドキュメントに例外が存在する場合があります。シスコのインクルーシブランゲージに対する取り組みの詳細は、こちらをご覧ください。
このドキュメントは、米国シスコ発行ドキュメントの参考和訳です。リンク情報につきましては、日本語版掲載時点で、英語版にアップデートがあり、リンク先のページが移動/変更されている場合がありますことをご了承ください。あくまでも参考和訳となりますので、正式な内容については米国サイトのドキュメントを参照ください。
この章は、次の項で構成されています。
Cisco UCS Director タスク ライブラリから利用可能なゲスト操作タスクを使用すれば、ゲスト VM でコマンドを実行できます。ゲスト操作タスクを使用すると、コマンドを実行してゲスト OS を操作できます。ゲスト操作タスクでは、ロールバックならびにコマンド出力およびエラー コードをキャプチャするためのオプションがサポートされています。
PowerShell、バッチ スクリプトまたはコマンド プロンプトのいずれかにより Windows ゲスト VM でコマンドを実行できます。
(注) | ゲスト操作タスクで VM を選択すると、OS タイプが自動的に選択されます。OS タイプを変更する必要はありません。 |
ゲスト操作タスクには、既存の VIX スクリプトの実行タスクと同じ機能が備わっています。さらに、ゲスト操作タスクは次の機能をサポートします。
ゲスト OS に ZIP ファイルをアップロードするためのオプション
ゲスト OS に ZIP ファイルをアップロードして実行するためのオプション
(注) | アップロードした ZIP ファイルには、ゲスト OS 上で実行する 1 つ以上のファイルが含まれている場合があります。 |
ゲスト操作タスクにより、ZIP ファイルが Cisco UCS Director の一時的な場所に抽出されます。たとえば、ファイルは /opt/infra/uploads/permanent/admin/1492532488911 に抽出されます。admin は、Cisco UCS Director のシステム管理者のログイン名です。
PowerShell コマンドを実行するには、ゲスト操作タスクの [実行パスおよびオプション(Executable Path and Options)] フィールドに以下の内容を入力します。
コマンド プロンプトでコマンドまたはバッチ スクリプト コマンドを実行するには、ゲスト操作タスクに以下の内容を入力します。
次の例に、ゲスト操作タスクを使用して VM で Windows または Linux コマンドを実行する方法を示します。
この例では、ゲスト操作タスクを使用して、単一行の Windows コマンドを実行します。
Cisco UCS Director アプライアンスで利用可能なゲスト操作タスクに、以下の情報を入力します。
Windows バッチ スクリプトを実行する VM を選択します。
VM の管理者クレデンシャルを入力します。
[OS タイプ(OS Type)] ドロップダウンリストから、[Windows] を選択します。
[実行パスおよびオプション(Executable Path and Options)] フィールドに、以下のサンプル Windows コマンドを入力します。
C:\\WINDOWS\\system32\\cmd.exe /c
[コマンド パス(Command Path)] フィールドに、以下のサンプル コマンドのパスを入力します。
mkdir C:\\test_Dir_1234
タスクの実行後、ログに以下の情報が表示されます。
Service Request ID: 1275 Jan 23, 2017 06:27:43 UTC Request submitted Jan 23, 2017 06:27:43 UTC Executing workflow item number 1 Jan 23, 2017 06:27:43 UTC Completed workflow item number 1, with status Completed Jan 23, 2017 06:27:47 UTC Executing workflow item number 2 Jan 23, 2017 06:27:47 UTC Trigger context executeWorkFlowStep called Jan 23, 2017 06:27:47 UTC Executing custom action GO_Windows_Select_Batch (VMware Guest Operations) Jan 23, 2017 06:27:47 UTC Executing custom action GO_Windows_Select_Batch (VMware Guest Operations) Jan 23, 2017 06:27:47 UTC Started executing command on guest VIXTest_DND_2012 Jan 23, 2017 06:27:54 UTC Completed executing command Jan 23, 2017 06:27:54 UTC Task #2 (GO_Windows_Select_Batch (VMware Guest Operations)) completed successfully in 6 seconds Jan 23, 2017 06:27:54 UTC Input/Output values for Task #2 (GO_Windows_Select_Batch (VMware Guest Operations)): Jan 23, 2017 06:27:54 UTC [Local Input: Select VM = 16483] Jan 23, 2017 06:27:54 UTC [Local Input: User Name = Administrator] Jan 23, 2017 06:27:54 UTC [Local Input: Password = **masked-value**] Jan 23, 2017 06:27:54 UTC [Local Input: OS Type = windows] Jan 23, 2017 06:27:54 UTC [Local Input: Guest Operations = executeCommand] Jan 23, 2017 06:27:54 UTC [Local Input: = null] Jan 23, 2017 06:27:54 UTC [Local Input: Guest File Path = null] Jan 23, 2017 06:27:54 UTC [Local Input: Executor Path and Arguments = C:\\WINDOWS\\system32\\cmd.exe /c] Jan 23, 2017 06:27:54 UTC [Local Input: Command Path = mkdir C:\\test_Dir_1234] Jan 23, 2017 06:27:54 UTC [Local Input: Undo Script = ] Jan 23, 2017 06:27:54 UTC [Local Input: Error Codes = ] Jan 23, 2017 06:27:54 UTC [Output: EXIT_STATUS_CODE = 0] Jan 23, 2017 06:27:54 UTC [Output: COMMAND_OUTPUT = ] Jan 23, 2017 06:27:54 UTC Completed workflow item number 2, with status Completed Jan 23, 2017 06:27:59 UTC Executing workflow item number 3 Jan 23, 2017 06:27:59 UTC Completed workflow item number 3, with status Completed
ログに表示されているように、コマンドは VM 上で直接実行されます。
この例では、ゲスト操作タスクを使用して、複数行の Windows コマンドを実行します。
Cisco UCS Director アプライアンスで利用可能なゲスト操作タスクに、以下の情報を入力します。
Windows バッチ スクリプトを実行する VM を選択します。
VM の管理者クレデンシャルを入力します。
[OS タイプ(OS Type)] ドロップダウンリストから、[Windows] を選択します。
[実行パスおよびオプション(Executable Path and Options)] フィールドに、以下のサンプル Windows コマンドを入力します。
C:\\WINDOWS\\system32\\cmd.exe /c
[コマンド パス(Command Path)] フィールドに、以下のサンプル コマンドのパスを入力します。
echo 1st file > C:\\One.txt && echo 2nd file > C:\\Two.txt
タスクの実行後、ログに以下の情報が表示されます。
Service Request ID: 1328 Feb 01, 2017 06:15:17 UTC Request submitted Feb 01, 2017 06:15:20 UTC Executing workflow item number 1 Feb 01, 2017 06:15:20 UTC Completed workflow item number 1, with status Completed Feb 01, 2017 06:15:26 UTC Executing workflow item number 2 Feb 01, 2017 06:15:26 UTC Trigger context executeWorkFlowStep called Feb 01, 2017 06:15:26 UTC Executing custom action Guest Operations testing (VMware Guest Operations) Feb 01, 2017 06:15:26 UTC Executing custom action Guest Operations testing (VMware Guest Operations) Feb 01, 2017 06:15:27 UTC Started executing command on guest VIXTest_DND_2012 Feb 01, 2017 06:15:33 UTC Completed executing command Feb 01, 2017 06:15:33 UTC Task #2 (Guest Operations testing (VMware Guest Operations)) completed successfully in 6 seconds Feb 01, 2017 06:15:33 UTC Input/Output values for Task #2 (Guest Operations testing (VMware Guest Operations)): Feb 01, 2017 06:15:33 UTC [Local Input: Select VM = 16483] Feb 01, 2017 06:15:33 UTC [Local Input: User Name = Administrator] Feb 01, 2017 06:15:33 UTC [Local Input: Password = **masked-value**] Feb 01, 2017 06:15:33 UTC [Local Input: OS Type = windows] Feb 01, 2017 06:15:33 UTC [Local Input: Guest Operations = executeCommand] Feb 01, 2017 06:15:33 UTC [Local Input: Upload File = null] Feb 01, 2017 06:15:33 UTC [Local Input: Guest File Path = null] Feb 01, 2017 06:15:33 UTC [Local Input: Executor Path and Options = C:\Windows\System32\cmd.exe /c] Feb 01, 2017 06:15:33 UTC [Local Input: Command Path = echo 1st file > c:\\One.txt && echo 2nd file > c:\\Two.txt] Feb 01, 2017 06:15:33 UTC [Local Input: Undo Script = ] Feb 01, 2017 06:15:33 UTC [Local Input: Error Codes = ] Feb 01, 2017 06:15:33 UTC [Output: EXIT_STATUS_CODE = 0] Feb 01, 2017 06:15:33 UTC [Output: COMMAND_OUTPUT = ] Feb 01, 2017 06:15:33 UTC Completed workflow item number 2, with status Completed Feb 01, 2017 06:15:38 UTC Executing workflow item number 3 Feb 01, 2017 06:15:38 UTC Completed workflow item number 3, with status Completed
ログに表示されているように、コマンドは VM 上で直接実行されます。
この例では、ゲスト操作タスクを使用して、単一行の Linux コマンドを実行します。
Cisco UCS Director アプライアンスで利用可能なゲスト操作タスクに、以下の情報を入力します。
Linux コマンドを実行する VM を選択します。
VM の管理者クレデンシャルを入力します。
[OS タイプ(OS Type)] ドロップダウンリストから、[Linux] を選択します。
[コマンド パス(Command Path)] フィールドに、以下のサンプル Linux コマンドを入力します。
/bin/mkdir /tmp/testdir1
タスクの実行後、ログに以下の情報が表示されます。
Service Request ID: 1272 Jan 23, 2017 06:17:45 UTC Request submitted Jan 23, 2017 06:17:47 UTC Executing workflow item number 1 Jan 23, 2017 06:17:47 UTC Completed workflow item number 1, with status Completed Jan 23, 2017 06:17:53 UTC Executing workflow item number 2 Jan 23, 2017 06:17:53 UTC Trigger context executeWorkFlowStep called Jan 23, 2017 06:17:53 UTC Executing custom action GO_Linux_Select (VMware Guest Operations) Jan 23, 2017 06:17:53 UTC Executing custom action GO_Linux_Select (VMware Guest Operations) Jan 23, 2017 06:17:54 UTC Started executing command on guest VIXTest_DND_CentOS_Auto_prs Jan 23, 2017 06:17:59 UTC Completed executing command Jan 23, 2017 06:18:00 UTC Task #2 (GO_Linux_Select (VMware Guest Operations)) completed successfully in 6 seconds Jan 23, 2017 06:18:00 UTC Input/Output values for Task #2 (GO_Linux_Select (VMware Guest Operations)): Jan 23, 2017 06:18:00 UTC [Local Input: Select VM = 16460] Jan 23, 2017 06:18:00 UTC [Local Input: User Name = root] Jan 23, 2017 06:18:00 UTC [Local Input: Password = **masked-value**] Jan 23, 2017 06:18:00 UTC [Local Input: OS Type = linux] Jan 23, 2017 06:18:00 UTC [Local Input: Guest Operations = executeCommand] Jan 23, 2017 06:18:00 UTC [Local Input: = null] Jan 23, 2017 06:18:00 UTC [Local Input: Guest File Path = null] Jan 23, 2017 06:18:00 UTC [Local Input: Executor Path and Arguments = null] Jan 23, 2017 06:18:00 UTC [Local Input: Command Path = /bin/mkdir /tmp/testdir1] Jan 23, 2017 06:18:00 UTC [Local Input: Undo Script = /bin/rmdir /tmp/testdir1] Jan 23, 2017 06:18:00 UTC [Local Input: Error Codes = ] Jan 23, 2017 06:18:00 UTC [Output: EXIT_STATUS_CODE = 0] Jan 23, 2017 06:18:00 UTC [Output: COMMAND_OUTPUT = ] Jan 23, 2017 06:18:00 UTC Completed workflow item number 2, with status Completed Jan 23, 2017 06:18:02 UTC Executing workflow item number 3 Jan 23, 2017 06:18:02 UTC Completed workflow item number 3, with status Completed
ログに表示されているように、コマンドは VM 上で直接実行されます。
この例では、ゲスト操作タスクを使用して、PowerShell で単一行の Windows コマンドを実行します。PowerShell でコマンドを実行するには、PowerShell とコマンドのパスを入力します。
Cisco UCS Director アプライアンスで利用可能なゲスト操作タスクに、以下の情報を入力します。
Windows コマンドを実行する VM を選択します。
VM の管理者クレデンシャルを入力します。
[OS タイプ(OS Type)] ドロップダウンリストから、[Windows] を選択します。
[実行パスおよびオプション(Executable Path and Options)] フィールドに、PowerShell のパスを入力します。
C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe
[コマンド パス(Command Path)] フィールドに、以下のサンプル コマンドのパスを入力します。
mkdir C:\\test_Dir_1234
タスクの実行後、ログに以下の情報が表示されます。
Service Request ID: 1277 Jan 23, 2017 06:32:27 UTC Request submitted Jan 23, 2017 06:32:32 UTC Executing workflow item number 1 Jan 23, 2017 06:32:32 UTC Completed workflow item number 1, with status Completed Jan 23, 2017 06:32:35 UTC Executing workflow item number 2 Jan 23, 2017 06:32:35 UTC Trigger context executeWorkFlowStep called Jan 23, 2017 06:32:35 UTC Executing custom action GO_Windows_Select_PowerShell (VMware Guest Operations) Jan 23, 2017 06:32:35 UTC Executing custom action GO_Windows_Select_PowerShell (VMware Guest Operations) Jan 23, 2017 06:32:35 UTC Started executing command on guest VIXTest_DND_2012 Jan 23, 2017 06:32:41 UTC Completed executing command Jan 23, 2017 06:32:42 UTC Task #2 (GO_Windows_Select_PowerShell (VMware Guest Operations)) completed successfully in 6 seconds Jan 23, 2017 06:32:42 UTC Input/Output values for Task #2 (GO_Windows_Select_PowerShell (VMware Guest Operations)): Jan 23, 2017 06:32:42 UTC [Local Input: Select VM = 16483] Jan 23, 2017 06:32:42 UTC [Local Input: User Name = Administrator] Jan 23, 2017 06:32:42 UTC [Local Input: Password = **masked-value**] Jan 23, 2017 06:32:42 UTC [Local Input: OS Type = windows] Jan 23, 2017 06:32:42 UTC [Local Input: Guest Operations = executeCommand] Jan 23, 2017 06:32:42 UTC [Local Input: = null] Jan 23, 2017 06:32:42 UTC [Local Input: Guest File Path = null] Jan 23, 2017 06:32:42 UTC [Local Input: Executor Path and Arguments = C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe] Jan 23, 2017 06:32:42 UTC [Local Input: Command Path = mkdir C:\\test_Dir_1234] Jan 23, 2017 06:32:42 UTC [Local Input: Undo Script = ] Jan 23, 2017 06:32:42 UTC [Local Input: Error Codes = ] Jan 23, 2017 06:32:42 UTC [Output: COMMAND_OUTPUT = Directory: C:\Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 1/22/2017 10:32 PM test_Dir_1234] Jan 23, 2017 06:32:42 UTC [Output: EXIT_STATUS_CODE = 0] Jan 23, 2017 06:32:42 UTC Completed workflow item number 2, with status Completed Jan 23, 2017 06:32:44 UTC Executing workflow item number 3 Jan 23, 2017 06:32:44 UTC Completed workflow item number 3, with status Completed
ログに表示されているように、コマンドは VM 上で直接実行されます。
この例では、ゲスト操作タスクを使用して、PowerShell で複数行の Windows コマンドを実行します。PowerShell でコマンドを実行するには、PowerShell とコマンドのパスを入力します。
Cisco UCS Director アプライアンスで利用可能なゲスト操作タスクに、以下の情報を入力します。
Windows コマンドを実行する VM を選択します。
VM の管理者クレデンシャルを入力します。
[OS タイプ(OS Type)] ドロップダウンリストから、[Windows] を選択します。
[実行パスおよびオプション(Executable Path and Options)] フィールドに、PowerShell のパスを入力します。
C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe
[コマンド パス(Command Path)] フィールドに、以下のサンプル コマンドのパスを入力します。
echo 1st file > C:\\One.txt echo 2nd file > C:\\Two.txt
タスクの実行後、ログに以下の情報が表示されます。
Service Request ID: 1329 Feb 01, 2017 06:23:20 UTC Request submitted Feb 01, 2017 06:23:21 UTC Executing workflow item number 1 Feb 01, 2017 06:23:21 UTC Completed workflow item number 1, with status Completed Feb 01, 2017 06:23:24 UTC Executing workflow item number 2 Feb 01, 2017 06:23:24 UTC Trigger context executeWorkFlowStep called Feb 01, 2017 06:23:24 UTC Executing custom action Guest Operations testing (VMware Guest Operations) Feb 01, 2017 06:23:24 UTC Executing custom action Guest Operations testing (VMware Guest Operations) Feb 01, 2017 06:23:25 UTC Started executing command on guest VIXTest_DND_2012 Feb 01, 2017 06:23:31 UTC Completed executing command Feb 01, 2017 06:23:31 UTC Task #2 (Guest Operations testing (VMware Guest Operations)) completed successfully in 6 seconds Feb 01, 2017 06:23:31 UTC Input/Output values for Task #2 (Guest Operations testing (VMware Guest Operations)): Feb 01, 2017 06:23:31 UTC [Local Input: Select VM = 16483] Feb 01, 2017 06:23:31 UTC [Local Input: User Name = Administrator] Feb 01, 2017 06:23:31 UTC [Local Input: Password = **masked-value**] Feb 01, 2017 06:23:31 UTC [Local Input: OS Type = windows] Feb 01, 2017 06:23:31 UTC [Local Input: Guest Operations = executeCommand] Feb 01, 2017 06:23:31 UTC [Local Input: Upload File = null] Feb 01, 2017 06:23:31 UTC [Local Input: Guest File Path = null] Feb 01, 2017 06:23:31 UTC [Local Input: Executor Path and Options = C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe] Feb 01, 2017 06:23:31 UTC [Local Input: Command Path = echo 1st file > C:\\One.txt echo 2nd file > C:\\Two.txt] Feb 01, 2017 06:23:31 UTC [Local Input: Undo Script = ] Feb 01, 2017 06:23:31 UTC [Local Input: Error Codes = ] Feb 01, 2017 06:23:31 UTC [Output: EXIT_STATUS_CODE = 0] Feb 01, 2017 06:23:31 UTC Completed workflow item number 2, with status Completed Feb 01, 2017 06:23:36 UTC Executing workflow item number 3 Feb 01, 2017 06:23:36 UTC Completed workflow item number 3, with status Completed
ログに表示されているように、コマンドは VM 上で直接実行されます。
ゲスト操作タスクでは、Windows または Linux のゲスト VM に ZIP 形式のバッチ スクリプト ファイルまたは ZIP 形式の PowerShell スクリプト ファイルをアップロードするオプションが提供されます。[ゲストへのファイルのアップロード(Upload File to Guest)] オプションを選択する場合、ZIP ファイルを選択して、ZIP ファイルをアップロードするゲスト VM 上のパスまたはディレクトリを指定する必要があります。アップロードした ZIP ファイルには、ゲスト OS 上で実行する 1 つ以上のファイルが含まれている場合があります。
ゲスト操作タスクにより、ZIP ファイルが Cisco UCS Director の一時的な場所に抽出されます。たとえば、ファイルは /opt/infra/uploads/admin/1488281478583 に抽出されます。admin は、Cisco UCS Director のシステム管理者のログイン名です。
(注) | ZIP ファイルをアップロードするには、ファイルサイズの 2 倍以上が Cisco UCS Director のディスク領域で利用可能である必要があります。 |
この例では、ゲスト操作タスクを使用して Windows ゲスト VM に ZIP ファイルをアップロードします。
Cisco UCS Director アプライアンスで利用可能なゲスト操作タスクに、以下の情報を入力します。
ZIP ファイルをアップロードする VM を選択します。
VM の管理者クレデンシャルを入力します。
[OS タイプ(OS Type)] ドロップダウンリストから、[Windows] を選択します。
[ゲスト操作(Guest Operations)] ドロップダウンリストから [ファイルをゲストにアップロード(Upload File to Guest)] を選択します。
[ファイル(File)] フィールドで、アップロードする ZIP ファイルをドラッグ アンド ドロップするか、[ファイルの選択(Select a File)] をクリックして、アップロードする ZIP ファイルを選択します。
[ゲスト OS のフォルダー パス(Guest OS Folder Path)] フィールドに、ZIP ファイルをアップロードする Windows ゲスト VM 上のパスを入力します。
C:\FileUpload\
タスクの実行後、ログに以下の情報が表示されます。
Service Request ID: 1282 Jan 23, 2017 07:01:28 UTC Request submitted Jan 23, 2017 07:01:29 UTC Executing workflow item number 1 Jan 23, 2017 07:01:29 UTC Completed workflow item number 1, with status Completed Jan 23, 2017 07:01:35 UTC Executing workflow item number 2 Jan 23, 2017 07:01:35 UTC Trigger context executeWorkFlowStep called Jan 23, 2017 07:01:35 UTC Executing custom action GO_Windows_Upload (VMware Guest Operations) Jan 23, 2017 07:01:35 UTC Executing custom action GO_Windows_Upload (VMware Guest Operations) Jan 23, 2017 07:01:35 UTC Started uploading file to guest VIXTest_DND_2012 Jan 23, 2017 07:01:36 UTC Completed file uploading Jan 23, 2017 07:01:36 UTC Task #2 (GO_Windows_Upload (VMware Guest Operations)) completed successfully in 0 seconds Jan 23, 2017 07:01:36 UTC Input/Output values for Task #2 (GO_Windows_Upload (VMware Guest Operations)): Jan 23, 2017 07:01:36 UTC [Local Input: Select VM = 16483] Jan 23, 2017 07:01:36 UTC [Local Input: User Name = Administrator] Jan 23, 2017 07:01:36 UTC [Local Input: Password = **masked-value**] Jan 23, 2017 07:01:36 UTC [Local Input: OS Type = windows] Jan 23, 2017 07:01:36 UTC [Local Input: Guest Operations = uploadFiletoGuest] Jan 23, 2017 07:01:36 UTC [Local Input: = sample.zip] Jan 23, 2017 07:01:36 UTC [Local Input: Guest OS Folder Path = C:\FileUpload\] Jan 23, 2017 07:01:36 UTC [Local Input: Executor Path and Arguments = null] Jan 23, 2017 07:01:36 UTC [Local Input: Command Path = null] Jan 23, 2017 07:01:36 UTC [Local Input: Undo Script = ] Jan 23, 2017 07:01:36 UTC [Local Input: Error Codes = ] Jan 23, 2017 07:01:36 UTC Completed workflow item number 2, with status Completed Jan 23, 2017 07:01:38 UTC Executing workflow item number 3 Jan 23, 2017 07:01:38 UTC Completed workflow item number 3, with status Completed
ログに表示されているように、コマンドは VM 上で直接実行されます。
この例では、ゲスト操作タスクを使用して Linux ゲスト VM に ZIP ファイルをアップロードします。
Cisco UCS Director アプライアンスで利用可能なゲスト操作タスクに、以下の情報を入力します。
ZIP ファイルをアップロードする VM を選択します。
VM の管理者クレデンシャルを入力します。
[OS タイプ(OS Type)] ドロップダウンリストから、[Linux] を選択します。
[ゲスト操作(Guest Operations)] ドロップダウンリストから [ファイルをゲストにアップロード(Upload File to Guest)] を選択します。
[ファイル(File)] フィールドで、アップロードする ZIP ファイルをドラッグ アンド ドロップするか、[ファイルの選択(Select a File)] をクリックして、アップロードする ZIP ファイルを選択します。
[ゲスト OS のフォルダー パス(Guest OS Folder Path)] フィールドに、ZIP ファイルをアップロードする Linux ゲスト VM 上のパスを入力します。
/tmp/FileUpload/
タスクの実行後、ログに以下の情報が表示されます。
Service Request ID: 1280 Jan 23, 2017 06:44:57 UTC Request submitted Jan 23, 2017 06:44:59 UTC Executing workflow item number 1 Jan 23, 2017 06:44:59 UTC Completed workflow item number 1, with status Completed Jan 23, 2017 06:45:02 UTC Executing workflow item number 2 Jan 23, 2017 06:45:02 UTC Trigger context executeWorkFlowStep called Jan 23, 2017 06:45:02 UTC Executing custom action GO_Linux_Upload (VMware Guest Operations) Jan 23, 2017 06:45:02 UTC Executing custom action GO_Linux_Upload (VMware Guest Operations) Jan 23, 2017 06:45:02 UTC Started uploading file to guest VIXTest_DND_CentOS Jan 23, 2017 06:45:08 UTC Completed file uploading Jan 23, 2017 06:45:08 UTC Task #2 (GO_Linux_Upload (VMware Guest Operations)) completed successfully in 5 seconds Jan 23, 2017 06:45:08 UTC Input/Output values for Task #2 (GO_Linux_Upload (VMware Guest Operations)): Jan 23, 2017 06:45:08 UTC [Local Input: Select VM = 16485] Jan 23, 2017 06:45:08 UTC [Local Input: User Name = root] Jan 23, 2017 06:45:08 UTC [Local Input: Password = **masked-value**] Jan 23, 2017 06:45:08 UTC [Local Input: OS Type = linux] Jan 23, 2017 06:45:08 UTC [Local Input: Guest Operations = uploadFiletoGuest] Jan 23, 2017 06:45:08 UTC [Local Input: = test.zip] Jan 23, 2017 06:45:08 UTC [Local Input: Guest OS Folder Path = /tmp/FileUpload/] Jan 23, 2017 06:45:08 UTC [Local Input: Executor Path and Arguments = null] Jan 23, 2017 06:45:08 UTC [Local Input: Command Path = null] Jan 23, 2017 06:45:08 UTC [Local Input: Undo Script = ] Jan 23, 2017 06:45:08 UTC [Local Input: Error Codes = ] Jan 23, 2017 06:45:08 UTC Completed workflow item number 2, with status Completed Jan 23, 2017 06:45:08 UTC Executing workflow item number 3 Jan 23, 2017 06:45:08 UTC Completed workflow item number 3, with status Completed
ログに表示されているように、コマンドは VM 上で直接実行されます。
ゲスト操作タスクでは、Windows または Linux のゲスト VM にアップロードした ZIP 形式のバッチ スクリプト ファイルまたは ZIP 形式の PowerShell スクリプト ファイルを実行するオプションが提供されます。アップロードした ZIP ファイルには、ゲスト OS 上で実行する 1 つ以上のファイルが含まれている場合があります。
(注) | ZIP ファイルをアップロードするには、ファイルサイズの 2 倍以上が Cisco UCS Director のディスク領域で利用可能である必要があります。 |
ゲスト操作タスクにより、ZIP ファイルが Cisco UCS Director の一時的な場所に抽出されます。たとえば、ファイルは /opt/infra/uploads/admin/1488281478583 に抽出されます。admin は、Cisco UCS Director のシステム管理者のログイン名です。
[アップロード ファイルの実行(Execute Uploaded File)] オプションを選択した場合は、以下を指定する必要があります。
ZIP 形式の単一のファイルをアップロードするゲスト VM 上のファイル パス、または ZIP 形式の複数のファイルをアップロードするゲスト VM 上のディレクトリ。
実行プログラムのパスとオプション(Windows ゲスト VM 用)
コマンド パス
この例では、バッチ スクリプト ファイルをアップロードし、ゲスト操作タスクを使用して Windows ゲスト VM でファイルを実行します。
Cisco UCS Director アプライアンスで利用可能なゲスト操作タスクに、以下の情報を入力します。
Windows バッチ スクリプトをアップロードして実行する VM を選択します。
VM の管理者クレデンシャルを入力します。
[OS タイプ(OS Type)] ドロップダウンリストから、[Windows] を選択します。
[ゲスト操作(Guest Operations)] ドロップダウンリストから [ファイルのアップロードと実行(Upload and Execute File)] を選択します。
[ファイル(File)] フィールドで、アップロードする ZIP ファイルをドラッグ アンド ドロップするか、[ファイルの選択(Select a File)] をクリックして、アップロードする ZIP ファイルを選択します。
[ゲスト OS のフォルダー パス(Guest OS Folder Path)] フィールドに、バッチ スクリプト ファイルをアップロードする Windows ゲスト VM 上のパスを入力します。
C:\FileUpload\
[実行パスおよびオプション(Executable Path and Options)] フィールドに、以下のサンプル Windows コマンドを入力します。
C:\WINDOWS\system32\cmd.exe /c
[コマンド パス(Command Path)] フィールドに、以下のサンプル コマンドのパスを入力します。
CALL C:\FileUpload\Sample.bat
タスクの実行後、ログに以下の情報が表示されます。
Service Request ID: 1294 Jan 23, 2017 07:50:20 UTC Request submitted Jan 23, 2017 07:50:21 UTC Executing workflow item number 1 Jan 23, 2017 07:50:21 UTC Completed workflow item number 1, with status Completed Jan 23, 2017 07:50:24 UTC Executing workflow item number 2 Jan 23, 2017 07:50:24 UTC Trigger context executeWorkFlowStep called Jan 23, 2017 07:50:24 UTC Executing custom action GO_ExecuteUploadedFile_Batch (VMware Guest Operations) Jan 23, 2017 07:50:24 UTC Executing custom action GO_ExecuteUploadedFile_Batch (VMware Guest Operations) Jan 23, 2017 07:50:25 UTC Started uploading file to guest VIXTest_DND_2012 Jan 23, 2017 07:50:25 UTC Completed file uploading Jan 23, 2017 07:50:25 UTC Started executing command on guest VIXTest_DND_2012 Jan 23, 2017 07:50:31 UTC Completed executing command Jan 23, 2017 07:50:31 UTC Task #2 (GO_ExecuteUploadedFile_Batch (VMware Guest Operations)) completed successfully in 6 seconds Jan 23, 2017 07:50:31 UTC Input/Output values for Task #2 (GO_ExecuteUploadedFile_Batch (VMware Guest Operations)): Jan 23, 2017 07:50:31 UTC [Local Input: Select VM = 16483] Jan 23, 2017 07:50:31 UTC [Local Input: User Name = Administrator] Jan 23, 2017 07:50:31 UTC [Local Input: Password = **masked-value**] Jan 23, 2017 07:50:31 UTC [Local Input: OS Type = windows] Jan 23, 2017 07:50:31 UTC [Local Input: Guest Operations = executeUploadedFile] Jan 23, 2017 07:50:31 UTC [Local Input: = Sample.zip] Jan 23, 2017 07:50:31 UTC [Local Input: Guest OS Folder Path = C:\FileUpload\] Jan 23, 2017 07:50:31 UTC [Local Input: Executor Path and Arguments = C:\Windows\System32\cmd.exe /c] Jan 23, 2017 07:50:31 UTC [Local Input: Command Path = CALL C:\FileUpload\Sample.bat] Jan 23, 2017 07:50:31 UTC [Local Input: Undo Script = null] Jan 23, 2017 07:50:31 UTC [Local Input: Error Codes = ] Jan 23, 2017 07:50:31 UTC [Output: EXIT_STATUS_CODE = 0] Jan 23, 2017 07:50:31 UTC [Output: COMMAND_OUTPUT = ] Jan 23, 2017 07:50:31 UTC Completed workflow item number 2, with status Completed Jan 23, 2017 07:50:36 UTC Executing workflow item number 3 Jan 23, 2017 07:50:36 UTC Completed workflow item number 3, with status Completed
ログに表示されているように、コマンドは VM 上で直接実行されます。
この例では、PowerShell スクリプト ファイルをアップロードし、ゲスト操作タスクを使用すれば Windows ゲスト VM でファイルを実行できます。PowerShell でコマンドを実行するには、PowerShell とコマンドのパスを入力します。
Cisco UCS Director アプライアンスで利用可能なゲスト操作タスクに、以下の情報を入力します。
Windows PowerShell スクリプトをアップロードして実行する VM を選択します。
VM の管理者クレデンシャルを入力します。
[OS タイプ(OS Type)] ドロップダウンリストから、[Windows] を選択します。
[ゲスト操作(Guest Operations)] ドロップダウンリストから [ファイルのアップロードと実行(Upload and Execute File)] を選択します。
[ファイル(File)] フィールドで、アップロードする ZIP ファイルをドラッグ アンド ドロップするか、[ファイルの選択(Select a File)] をクリックして、アップロードする ZIP ファイルを選択します。
[ゲスト OS のフォルダー パス(Guest OS Folder Path)] フィールドに、PowerShell スクリプト ファイルをアップロードする Windows ゲスト VM 上のパスを入力します。
C:\FileUpload\
[実行パスおよびオプション(Executable Path and Options)] フィールドに、以下のサンプル Windows コマンドを入力します。
C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe
[コマンド パス(Command Path)] フィールドに、以下のサンプル コマンドのパスを入力します。
Invoke-Expression C:\FileUpload\sample.ps1
タスクの実行後、ログに以下の情報が表示されます。
Service Request ID: 1295 Jan 23, 2017 07:56:51 UTC Request submitted Jan 23, 2017 07:56:57 UTC Executing workflow item number 1 Jan 23, 2017 07:56:57 UTC Completed workflow item number 1, with status Completed Jan 23, 2017 07:57:00 UTC Executing workflow item number 2 Jan 23, 2017 07:57:00 UTC Trigger context executeWorkFlowStep called Jan 23, 2017 07:57:00 UTC Executing custom action GO_ExecuteUploadedFile_PowerShell (VMware Guest Operations) Jan 23, 2017 07:57:00 UTC Executing custom action GO_ExecuteUploadedFile_PowerShell (VMware Guest Operations) Jan 23, 2017 07:57:01 UTC Started uploading file to guest VIXTest_DND_2012 Jan 23, 2017 07:57:01 UTC Completed file uploading Jan 23, 2017 07:57:01 UTC Started executing command on guest VIXTest_DND_2012 Jan 23, 2017 07:57:07 UTC Completed executing command Jan 23, 2017 07:57:08 UTC Task #2 (GO_ExecuteUploadedFile_PowerShell (VMware Guest Operations)) completed successfully in 7 seconds Jan 23, 2017 07:57:08 UTC Input/Output values for Task #2 (GO_ExecuteUploadedFile_PowerShell (VMware Guest Operations)): Jan 23, 2017 07:57:08 UTC [Local Input: Select VM = 16483] Jan 23, 2017 07:57:08 UTC [Local Input: User Name = Administrator] Jan 23, 2017 07:57:08 UTC [Local Input: Password = **masked-value**] Jan 23, 2017 07:57:08 UTC [Local Input: OS Type = windows] Jan 23, 2017 07:57:08 UTC [Local Input: Guest Operations = executeUploadedFile] Jan 23, 2017 07:57:08 UTC [Local Input: = sample.zip] Jan 23, 2017 07:57:08 UTC [Local Input: Guest OS Folder Path = C:\FileUpload\] Jan 23, 2017 07:57:08 UTC [Local Input: Executor Path and Arguments = C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe] Jan 23, 2017 07:57:08 UTC [Local Input: Command Path = Invoke-Expression C:\FileUpload\sample.ps1] Jan 23, 2017 07:57:08 UTC [Local Input: Undo Script = null] Jan 23, 2017 07:57:08 UTC [Local Input: Error Codes = ] Jan 23, 2017 07:57:08 UTC [Output: COMMAND_OUTPUT = Directory: C:\Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 1/22/2017 11:56 PM testWinPSAPI] Jan 23, 2017 07:57:08 UTC [Output: EXIT_STATUS_CODE = 0] Jan 23, 2017 07:57:08 UTC Completed workflow item number 2, with status Completed Jan 23, 2017 07:57:09 UTC Executing workflow item number 3 Jan 23, 2017 07:57:09 UTC Completed workflow item number 3, with status Completed
ログに表示されているように、コマンドは VM 上で直接実行されます。
この例では、ファイルをアップロードし、ゲスト操作タスクを使用して Linux ゲスト VM でファイルを実行します。
Cisco UCS Director アプライアンスで利用可能なゲスト操作タスクに、以下の情報を入力します。
アップロードを実行する VM を選択して、Linux ファイルを実行します。
VM の管理者クレデンシャルを入力します。
[OS タイプ(OS Type)] ドロップダウンリストから、[Linux] を選択します。
[ゲスト操作(Guest Operations)] ドロップダウンリストから [ファイルのアップロードと実行(Upload and Execute File)] を選択します。
[ファイル(File)] フィールドで、アップロードする ZIP ファイルをドラッグ アンド ドロップするか、[ファイルの選択(Select a File)] をクリックして、アップロードする ZIP ファイルを選択します。
[ゲスト OS のフォルダー パス(Guest OS Folder Path)] フィールドに、ファイルをアップロードする Linux ゲスト VM 上のパスを入力します。
/tmp/FileUpload/
[コマンド パス(Command Path)] フィールドに、以下のサンプル コマンドのパスを入力します。
/bin/sh /tmp/FileUpload/test.sh
タスクの実行後、ログに以下の情報が表示されます。
Service Request ID: 1327 Feb 01, 2017 06:05:30 UTC Request submitted Feb 01, 2017 06:05:32 UTC Executing workflow item number 1 Feb 01, 2017 06:05:32 UTC Completed workflow item number 1, with status Completed Feb 01, 2017 06:05:38 UTC Executing workflow item number 2 Feb 01, 2017 06:05:38 UTC Trigger context executeWorkFlowStep called Feb 01, 2017 06:05:38 UTC Executing custom action GO_Linux_ExecuteUploadedFile (VMware Guest Operations) Feb 01, 2017 06:05:38 UTC Executing custom action GO_Linux_ExecuteUploadedFile (VMware Guest Operations) Feb 01, 2017 06:05:38 UTC Started uploading file to guest VIXTest_DND_CentOS Feb 01, 2017 06:05:44 UTC Completed file uploading Feb 01, 2017 06:05:44 UTC Started executing command on guest VIXTest_DND_CentOS Feb 01, 2017 06:05:50 UTC Completed executing command Feb 01, 2017 06:05:50 UTC Task #2 (GO_Linux_ExecuteUploadedFile (VMware Guest Operations)) completed successfully in 11 seconds Feb 01, 2017 06:05:50 UTC Input/Output values for Task #2 (GO_Linux_ExecuteUploadedFile (VMware Guest Operations)): Feb 01, 2017 06:05:50 UTC [Local Input: Select VM = 16485] Feb 01, 2017 06:05:50 UTC [Local Input: User Name = root] Feb 01, 2017 06:05:50 UTC [Local Input: Password = **masked-value**] Feb 01, 2017 06:05:50 UTC [Local Input: OS Type = linux] Feb 01, 2017 06:05:50 UTC [Local Input: Guest Operations = executeUploadedFile] Feb 01, 2017 06:05:50 UTC [Local Input: Upload File = test.zip] Feb 01, 2017 06:05:50 UTC [Local Input: Guest OS Folder Path = /tmp/FileUpload/] Feb 01, 2017 06:05:50 UTC [Local Input: Executor Path and Options = null] Feb 01, 2017 06:05:50 UTC [Local Input: Command Path = /bin/sh /tmp/FileUpload/test.sh] Feb 01, 2017 06:05:50 UTC [Local Input: Undo Script = null] Feb 01, 2017 06:05:50 UTC [Local Input: Error Codes = ] Feb 01, 2017 06:05:50 UTC [Output: EXIT_STATUS_CODE = 0] Feb 01, 2017 06:05:50 UTC [Output: COMMAND_OUTPUT = ] Feb 01, 2017 06:05:50 UTC Completed workflow item number 2, with status Completed Feb 01, 2017 06:05:50 UTC Executing workflow item number 3 Feb 01, 2017 06:05:50 UTC Completed workflow item number 3, with status Completed
ログに表示されているように、コマンドは VM 上で直接実行されます。