zaki@stilton:~$ ./govc_linux_amd64 vm.create \ > -m 2048 \ > -c 2 \ > -g rhel7_64Guest \ > -net.adapter vmxnet3 \ > -ds datastore1 \ > -disk.controller pvscsi \ > test-vm ./govc_linux_amd64: ServerFaultCode: Current license or ESXi version prohibits execution of the requested operation. zaki@stilton:~$
あれっ…?
Licensing
Access to the vSphere API is governed by the variousvSphere Editions which provides both read and write access to the API. If you are using vSphere Hypervisor (free edition of ESXi), the vSphere API will only be available as read-only.
なるほど。。 govc以外にもサードパーティ製のAPI操作でVM作ったりはできないのね。
参照は可能。
zaki@stilton:~$ ./govc_linux_amd64 host.info Name: localhost.example.org Path: /ha-datacenter/host/localhost.example.org/localhost.example.org Manufacturer: Intel(R) Client Systems Logical CPUs: 8 CPUs @ 2712MHz Processor type: Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz CPU usage: 42 MHz (0.2%) Memory: 65404MB Memory usage: 2044 MB (3.1%) Boot time: 2019-10-02 07:37:58.19997 +0000 UTC State: connected zaki@stilton:~$
ちなみにgovcは、CLIでvSphereの操作をいろいろできるフリーのツール。(Go製)
今回やろうとしてたVM作ったりNICを追加したりディスクを作成したり…いろいろできる。
使うにはReleaseページからプラットフォーム用のバイナリをダウンロードしてgunzip
して実行権限付ければ使える。
VMによってNICの数やディスクの数が違う構成でも、YAMLで設定書いてAnsibleのshellモジュールでgovc実行してVMぽこぽこ作ったりするツールを仕事で用意したりしたので、家でもできたらなーと思ってたんだけどねorz
実際に使う場合は以下の通り