vmware_vm_shellモジュールを使用して、Windows Server 2012R2 vmware ゲスト マシンの IP を変更しようとしています。これまでのところ、問題なくvsphere_guestモジュールを使用してテンプレートから VM のクローンを作成できましたが、次のタスクを実行して IP を変更しようとすると、次のようになります。
- name: Configure IP address
local_action:
module: vmware_vm_shell
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_user }}"
password: "{{ vcenter_password }}"
cluster: "{{ Cluster }}"
vm_id: "{{ machine }}"
vm_username: "{{ machineUser }}"
vm_password: "{{ ansible_windows_password }}"
vm_shell: "C:\\Windows\\System32\\WindowsPowershell\\1.0\\powershell.exe"
vm_shell_args: " -command (Get-NetAdapter -Name Ethernet |New-NetIPAddress -InterfaceAlias Ethernet -AddressFamily IPv4 -IPAddress {{ new_machine_ip }} -PrefixLength {{ new_machine_mask_bits }} -DefaultGateway {{ new_machine_gateway }} )-and (Set-DnsClientServerAddress -InterfaceAlias Ethernet -ServerAddresses {{ new_machine_dns }})"
vm_shell_cwd: "C:\\Windows\\Temp"
validate_certs: False
Ansible からの応答は"msg": "File <unspecified filename> was not found"
.
pyvmomi-community-samplesexecute_program_in_vm.py
からスクリプトを実行しようとすると、同じエラーが発生します。Caught vmodl fault : File <unspecified filename> was not found
私が持っている vmware ユーザーには、すべてのGuest Operations
権限が設定されています。ここで何が欠けていますか?
PS:このガイドに従いました。