PowerCLI インストール (docker)
Ubuntu への docker と PowerCLI のインストール
docker インストール
apt install
sudo apt install docker.io
PowerCLI install
with docker
sudo su -
root@ubuntu22:~# systemctl status containerd.service
● containerd.service - containerd container runtime
Loaded: loaded (/lib/systemd/system/containerd.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2024-02-02 16:48:51 JST; 1min 5s ago
Docs: https://containerd.io
Main PID: 2615 (containerd)
Tasks: 10
Memory: 14.7M
CPU: 572ms
CGroup: /system.slice/containerd.service
mq2615 /usr/bin/containerd
2月 02 16:48:51 ubuntu22 containerd[2615]: time="2024-02-02T16:48:51.511503688+09:00" level=info m>
2月 02 16:48:51 ubuntu22 containerd[2615]: time="2024-02-02T16:48:51.511633595+09:00" level=info m>
2月 02 16:48:51 ubuntu22 containerd[2615]: time="2024-02-02T16:48:51.511755423+09:00" level=info m>
2月 02 16:48:51 ubuntu22 containerd[2615]: time="2024-02-02T16:48:51.511812952+09:00" level=info m>
2月 02 16:48:51 ubuntu22 containerd[2615]: time="2024-02-02T16:48:51.511836373+09:00" level=info m>
2月 02 16:48:51 ubuntu22 containerd[2615]: time="2024-02-02T16:48:51.511876160+09:00" level=info m>
2月 02 16:48:51 ubuntu22 containerd[2615]: time="2024-02-02T16:48:51.511965293+09:00" level=info m>
2月 02 16:48:51 ubuntu22 containerd[2615]: time="2024-02-02T16:48:51.512088658+09:00" level=info m>
2月 02 16:48:51 ubuntu22 containerd[2615]: time="2024-02-02T16:48:51.512201855+09:00" level=info m>
2月 02 16:48:51 ubuntu22 systemd[1]: Started containerd container runtime.
root@ubuntu22:~#
docker pull
docker pull vmware/powerclicore:latest
root@ubuntu22:~# docker pull vmware/powerclicore:latest
latest: Pulling from vmware/powerclicore
ca1778b69356: Pull complete
052498a0600e: Pull complete
e4bb439630bb: Pull complete
6c548366e47a: Pull complete
21c27127fa53: Pull complete
45ba8533c4dc: Pull complete
149c0c565f74: Pull complete
a4218067cd6b: Pull complete
4d4343a21bed: Pull complete
fa5ef76a57a5: Pull complete
Digest: sha256:5d13398ec75c0c3858f2f68a598db4368f4c22a98d0d67ce926b181e420778d3
Status: Downloaded newer image for vmware/powerclicore:latest
docker.io/vmware/powerclicore:latest
root@ubuntu22:~#
docker run
docker run --rm -it vmware/powerclicore
root@ubuntu22:~# docker run --rm -it vmware/powerclicore
PowerShell 7.2.11
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
PS /root>
PowerCLI確認
バージョン
$PSVersionTable
PS /root> $PSVersionTable
Name Value
---- -----
PSVersion 7.2.11
PSEdition Core
GitCommitId 7.2.11
OS Linux 5.15.0-92-generic #102-Ubuntu SMP Wed Jan 10 09:33:48 UTC 2024
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS /root>
vCenter接続
Connect-VIServer -Server 192.168.0.100 -User [email protected] -Password 'xxxxxxxx' -f
PS /root> Connect-VIServer -Server 192.168.0.100 -User [email protected] -Password 'xxxxxxxx' -f
Name Port User
---- ---- ----
192.168.0.100 443 VSPHERE.LOCAL\Administrator
PS /root>
動作確認
PS /root> Get-VM
Name PowerState Num CPUs MemoryGB
---- ---------- -------- --------
ubuntu2204 PoweredOff 4 8.000
ZABBIX PoweredOn 4 4.000
UBUNTU22 PoweredOn 4 8.000
WinDev2311Eval PoweredOff 4 8.000
vCenter PoweredOn 4 19.000
K8S-00 PoweredOn 4 8.000
JMETER-DESKTOP PoweredOn 4 8.000
JMETER PoweredOff 4 8.000
UBUNTU22-DESKTOP PoweredOff 4 8.000
PS /root>
参考
https://github.com/vmware/powerclicore