-
1. Re: command works on windows, but fails on linux powercli
LucD Feb 8, 2019 6:18 AM (in response to dalo)How did you connect to the vSphere server?
What is in $global:defaultviservers in both environments -
2. Re: command works on windows, but fails on linux powercli
dalo Feb 8, 2019 6:58 AM (in response to LucD)connect on both:
Connect-VIServer ourVC -credential(get-credential)
var on both:
$global:defaultviservers
Name Port User
---- ---- ----
ourVC 443 domain\myuser
-
3. Re: command works on windows, but fails on linux powercli
LucD Feb 8, 2019 7:03 AM (in response to dalo)Does the Get-ErrorReport cmdlet give any additional information on the exception?
-
4. Re: command works on windows, but fails on linux powercli
dalo Feb 8, 2019 7:35 AM (in response to LucD)Thank you, I wasn't aware of the Get-ErrorReport cmdlet.
I made it this way, is that ok?
Now I've to examine the zip File, there is a lot of information. Should I primary look fore errors and warnings?
$script = {new-vm -name myvm -ResourcePool mypool -Location myfolder}
$script| Get-ErrorReport -Destination "/tmp/error-reports"
WARNING: The 'IsChildTypeVm' property of the Folder type is deprecated. Use the Type property instead. WARNING: The 'IsChildTypeComputeResource' property of the Folder type is deprecated. Use the Type property instead. WARNING: The 'IsChildTypeDatacenter' property of the Folder type is deprecated. Use the Type property instead. WARNING: The 'IsChildTypeDatastore' property of the Folder type is deprecated. Use the Type property instead. WARNING: The 'DrsMode' property of Cluster type is deprecated. Use the 'DrsAutomationLevel' property instead. Mode LastWriteTime Length Name ---- ------------- ------ ---- ------ 2/8/19 3:27 PM 2840597 VMware-PowerCLI-Support-2019-02-08T15-27-04.zip
-
5. Re: command works on windows, but fails on linux powercli
LucD Feb 8, 2019 7:54 AM (in response to dalo)If you could find more specific info about the type of exception, that could help.
-
6. Re: command works on windows, but fails on linux powercli
dalo Feb 8, 2019 7:55 AM (in response to dalo)The zip contains the files below. The smaller ones doesn't contain something new.
In the PowerCLI-Main-Log.txt I could not identify something helpful.
---------- 1 root root 25444853 Feb 8 15:27 PowerCLI-Main-Log.txt
---------- 1 root root 26 Feb 8 15:27 Powershell-Debug-Stream.txt
---------- 1 root root 377 Feb 8 15:27 Powershell-Error-Stream.txt
---------- 1 root root 0 Feb 8 15:27 Powershell-Info-Stream.txt
---------- 1 root root 44 Feb 8 15:27 Powershell-Verbose-Stream.txt
---------- 1 root root 0 Feb 8 15:27 Powershell-Warning-Stream.txt
-
7. Re: command works on windows, but fails on linux powercli
LucD Feb 8, 2019 8:37 AM (in response to dalo)Can you, immediately after the error, run this?
$error[0].exception$error[0].exception.innerexception
-
8. Re: command works on windows, but fails on linux powercli
dalo Feb 10, 2019 11:25 PM (in response to LucD)Thank you for your patience LucD!
$error[0].exception
2/11/19 6:42:18 AM New-VM
and
$error[0].exception.innerexception
Returns nothing
-
9. Re: command works on windows, but fails on linux powercli
LucD Feb 11, 2019 12:35 AM (in response to dalo)That doesn't give us a lot more info.
Which Linux distro are you using?
-
10. Re: command works on windows, but fails on linux powercli
dalo Feb 11, 2019 1:04 AM (in response to LucD)Yes I'ts not very useful..
My distro is Ubuntu 18.04.1 LTS.
I tried now the same setup (user with reduced permissions) on our Test VC 6.7 (Prod is 6.5) with the same result: Works on a Win PS but not on Linux.
-
11. Re: command works on windows, but fails on linux powercli
LucD Feb 11, 2019 4:14 AM (in response to dalo)I just tried the same you are doing, with a user in the root group and a regular user.
For both the New-VM works.
I connected to the vCenter with a SSO account (same in both cases).I'm using PowerShell 6.1.2 and VMware PowerCLI 11.1.0.
The PowerCLI modules are installed in the scope AllUsers (modules in /usr/local/share/powershell/Modules).
Are any of these different on your station?
-
12. Re: command works on windows, but fails on linux powercli
dalo Feb 11, 2019 4:50 AM (in response to LucD)Our Setup:
PowerShell 6.1.2
VMware PowerCLI 11.0.0 build 10380590
Modules are in /usr/local/share/powershell/Modules
The user (from AD) has a Role with special permissions:
Datastore.AllocateSpace
Datastore.Browse
Host.Local.CreateVM
Host.Local.DeleteVM
Host.Local.ReconfigVM
Network.Assign
Resource.AssignVMToPool
System.Anonymous
System.Read
System.View
VirtualMachine.Config.AddExistingDisk
VirtualMachine.Config.AddNewDisk
VirtualMachine.Config.AddRemoveDevice
VirtualMachine.Config.CPUCount
VirtualMachine.Config.DiskExtend
VirtualMachine.Config.EditDevice
VirtualMachine.Config.Memory
VirtualMachine.Config.MksControl
VirtualMachine.Config.RemoveDisk
VirtualMachine.Config.Resource
VirtualMachine.Config.Settings
VirtualMachine.Interact.AnswerQuestion
VirtualMachine.Interact.ConsoleInteract
VirtualMachine.Interact.CreateScreenshot
VirtualMachine.Interact.PowerOff
VirtualMachine.Interact.PowerOn
VirtualMachine.Interact.Reset
VirtualMachine.Interact.SetCDMedia
VirtualMachine.Interact.ToolsInstall
VirtualMachine.Inventory.Create
VirtualMachine.Inventory.CreateFromExisting
VirtualMachine.Inventory.Delete
VirtualMachine.Inventory.Move
VirtualMachine.Provisioning.Clone
VirtualMachine.State.CreateSnapshot
VirtualMachine.State.RemoveSnapshot
VirtualMachine.State.RenameSnapshot
VirtualMachine.State.RevertToSnapshot
Assigned on:
- 1 Datastore
- 1 Folder
- 1 Network
- 1 Ressource Pool
-
13. Re: command works on windows, but fails on linux powercli
LucD Feb 11, 2019 5:04 AM (in response to dalo)Ok, that's different.
So you are running powershell on the Linux box with the same account.Do you start pwsh with sudo or not?
And the difference is in the Connect-VIServer account.
Once with an account that is in the Admin group (is that a SSO account ?) and once with an AD account, that is not in the Admin group.
Is that correct?
-
14. Re: command works on windows, but fails on linux powercli
dalo Feb 11, 2019 5:09 AM (in response to LucD)On The Linuxbox I tried both: running PS as local user and as root.
Then I login to VC with the SSO user (not the same as on the linux box)
On The Windows I opened a PS as local user and connect to VC with the same SSO User as above in the Linux.
Does this make sense?