1. What's a VIB ?
https://blogs.vmware.com/vsphere/2011/09/whats-in-a-vib.html
You cannot add services without installing a VIB.
https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.security.doc/GUID-37AB1F95-DDFD-4A5D-BD49-3249386FFADE.html
Every time when ESXi reboot, files not installed by VIBs would be deleted. The files would be removed when the VIB is removed too.
2. how to make customer VIBs?
2.1. prepare builder environment
2.1.1. host environment
note: 1. download vibauthor tool http://labs.vmware.com/flings/vib-author
2. the vibauthor tool is depended on python2.6 , so the builder is better be CentOS6 which is using python2.6 by default.
1
2
3
4
|
yum install glibc.i686
yum install -y python-lxml
wget https: //download3 .vmware.com /software/vmw-tools/vibauthor/vmware-esx-vib-author-5 .0.0-0.0.847598.i386.rpm
rpm -i vmware-esx-vib-author-5.0.0-0.0.847598.i386.rpm
|
2.1.2. docker environment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
[root@localhost ~] # docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
imagine10255 /centos6-lnmp-php56 latest e2824c76d481 3 years ago 1.314 GB #centos6
lamw /vibauthor latest c19c8a8faa8f 4 years ago 464.9 MB #vibauthor docker
#docker commands
docker pull imagine10255 /centos6-lnmp-php56 #拉鏡像
docker images #查看鏡像
docker run -it - v /root : /root imagine10255 /centos6-lnmp-php56 /bin/bash #創建容器,並掛載共享目錄
#查看當前系統容器
[root@localhost ~] # docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3d049e5a1f03 imagine10255 /centos6-lnmp-php56 "/bin/bash" 5 hours ago Up 5 hours 22 /tcp , 80 /tcp , 8080 /tcp thirsty_curie
15f159bc2bd7 imagine10255 /centos6-lnmp-php56 "bash" 8 hours ago Up 8 hours 22 /tcp , 80 /tcp , 8080 /tcp adoring_visvesvaraya
docker start 3d049e5a1f03
docker attach 3d049e5a1f03
|
2.2. vibauthor commands
1
2
3
|
[root@3d049e5a1f03 stagedir] # vibauthor -C -t /stagedir -v MyRule.vib -O MyRule.zip -f
Successfully created MyRule.vib.
Successfully created MyRule.zip.
|
2.3. esxcli commands
refer document:
https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.security.doc/GUID-751034F3-5337-4DB2-8272-8DAC0980EACA.html?hWord=N4IghgNiBcIG4EsBGIC+Q
1
2
3
4
5
6
7
8
9
10
|
[root@optimus-node01:~] esxcli software acceptance get
CommunitySupported
esxcli software acceptance set --level acceptance_level
[root@optimus-node01:~] esxcli software vib list
Name Version Vendor Acceptance Level Install Date
--------------------------------- ------------------------------------ ---------- ------------------ ------------
dell-shared-perc8 06.806.90.00-1OEM.650.0.0.4598673 Avago VMwareCertified 2020-04-14
bnxtnet 214.0.230.0-1OEM.670.0.0.8169922 BCM VMwareCertified 2020-04-14
|
1
2
3
4
5
6
7
|
[root@optimus-node01:~] esxcli software vib remove --vibname=MyRule
Removal Result
Message: Operation finished successfully.
Reboot Required: false
VIBs Installed:
VIBs Removed: None_bootbank_MyRule_5.0.0-1.0
VIBs Skipped:
|
1
2
3
4
5
6
7
8
9
|
[root@optimus-node01:~] esxcli software vib install - v /MyRule .vib --no-sig-check #for accepted level, and without signature.
[root@optimus-node01:~] esxcli software vib install - v /MyRule .vib -f #There should be abs path.
Installation Result
Message: Operation finished successfully.
Reboot Required: false
VIBs Installed: None_bootbank_MyRule_5.0.0-1.0
VIBs Removed:
VIBs Skipped:
|
3. 常見錯誤
Take it as example, I am trying to put a new file yang to /etc/init.d/ , but when installing the vib, error happened.
As the error message says, it is when the system want to run '/etc/init.d/yang start install', the command failed, so the installation interrupted too.
There we can see, the script should meet some certain requirements if we want to put it under /etc/init.d/ .
I believe for other directories, they may have different requirements too.
1
2
3
4
5
6
7
|
[root@optimus-node01:~] esxcli software vib install - v /MyRule .vib --no-sig-check
[LiveInstallationError]
Error running command '[' /etc/init .d /yang ', ' start ', ' install ']' : [Errno 8] Exec format error
It is not safe to continue . Please reboot the host immediately to discard the unfinished update.
Please refer to the log file for more details.
注意: /etc/init .d/ 下得腳本需要支持 start 參數。
|
4. Refer
https://communities.vmware.com/thread/476658