I would like to be able to mount a datastore on multiple ESX hosts, and the idea was to do that from Powershell Core (7.2) from a Linux host.
Posh-SSH doesn't seem to work because it is compiled against the full .Net, instead of the .Net used fro PS Core. It looks like I can use Posh-SSH only from a windows machine.
The other way to go, as I understand it, is to use New-PSSession, but when i issue the command
$session = New-PSSession -HostName <name_of_esx_host> -Username <name_of_user>
first, the ESX host is added to known host, then I get the prompt for my password, and then the error :
New-PSSession: [name_of_esx_host] The background process reported an error with the following message: The SSH client session has ended with error message: subsystem request failed on channel 0.
(Service SSH was started on the ESX host...)
It looks like there's still something wrong on the ESX host, but I can't find what it is.
Can anyone please tell me how to do this (and please, bear in mind that ideally I would like to achieve this from a Linux machine, not from Windows...)
But no experience whatsoever with the Get-EsxCli commands.
To be honest, I looked at it, but didn't quite understand the command. Specifically, I want to mount
a datastore permanent, but without deleting the data on it...(Disaster/Recover testing).
Do you have a link with some code, please, so I can try to understand this method ?