Имея много серверов Supermicro, мы несколько раз использовали виртуальные носители для установки, диагностики и спасения сервера Supermicro. Действительно просто открыть перенаправление консоли – java web start и просто смонтировать ISO-файл с виртуального носителя -> ISO-файл, но таким образом, если ваш сервер не является локальным для вашей сети и он расположен в colocation, как и должно быть, соединение медленное и во многих случаях поддельное! Поскольку он использует UDP, много раз случалось перемонтировать или просто потерять соединение, а носитель исчезал, например, в середине процесса загрузки с установочного носителя. И, вероятно, вы заметили, что в веб-интерфейсе есть дополнительная опция монтирования ISO-файла из общего ресурса Windows. Конечно, в мире Linux это может быть samba share, как в нашем случае, и общий ресурс может быть легко настроен на сервере в вашем местоположении.
И мы заметили, что несколько раз у нас не возникало проблем с его использованием, но некоторое время общий ресурс не мог быть даже сохранен и, соответственно, не мог быть смонтирован. Сообщений об ошибках не поступало, просто поля редактирования сбрасывались на пустые, и, по-видимому, все было таким же, как в предыдущем поле, которое сработало как шарм!
Ниже приведены шаги, позволяющие одному из ваших серверов CentOS 7 совместно использовать ресурс и использовать его в вашем Supermicro IPMI KVM. На сервере включен selinux, и политика применяется.

STEP 1) Install samba server in CentOS 7

yum -y install samba samba-client samba-common policycoreutils-python

 

[root@storage iso]# yum -y install samba samba-client samba-common policycoreutils-python
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.nsc.ru
* centos-qemu-ev: ftp.nsc.ru
* elrepo: ftp.nluug.nl
* epel: ru.download.ispsystem.com
* extras: ftp.nsc.ru
* ispsystem-base: ru.download.ispsystem.com
* ispsystem-stable5: ru.download.ispsystem.com
* updates: mirror.corbina.net
base | 3.6 kB 00:00:00
centos-qemu-ev | 3.0 kB 00:00:00
elrepo | 3.0 kB 00:00:00
epel | 3.0 kB 00:00:00
extras | 2.9 kB 00:00:00
ispsystem-base | 3.0 kB 00:00:00
ispsystem-stable5 | 3.0 kB 00:00:00
updates | 2.9 kB 00:00:00
zabbix | 2.9 kB 00:00:00
zabbix-non-supported | 2.9 kB 00:00:00
(1/2): updates/7/x86_64/primary_db | 19 MB 00:00:01
(2/2): epel/primary_db | 17 MB 00:00:03
Resolving Dependencies
--> Running transaction check
---> Package policycoreutils-python.x86_64 0:2.5-34.el7 will be installed
--> Processing Dependency: setools-libs >= 3.3.8-4 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libsemanage-python >= 2.5-14 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
---> Package samba.x86_64 0:4.10.16-9.el7_9 will be updated
---> Package samba.x86_64 0:4.10.16-20.el7_9 will be an update
--> Processing Dependency: samba-libs = 4.10.16-20.el7_9 for package: samba-4.10.16-20.el7_9.x86_64
--> Processing Dependency: samba-common-tools = 4.10.16-20.el7_9 for package: samba-4.10.16-20.el7_9.x86_64
--> Processing Dependency: samba-common-libs = 4.10.16-20.el7_9 for package: samba-4.10.16-20.el7_9.x86_64
--> Processing Dependency: samba-client-libs = 4.10.16-20.el7_9 for package: samba-4.10.16-20.el7_9.x86_64
--> Processing Dependency: libwbclient = 4.10.16-20.el7_9 for package: samba-4.10.16-20.el7_9.x86_64
--> Processing Dependency: libwbclient = 4.10.16-20.el7_9 for package: samba-4.10.16-20.el7_9.x86_64
---> Package samba-client.x86_64 0:4.10.16-9.el7_9 will be updated
---> Package samba-client.x86_64 0:4.10.16-20.el7_9 will be an update
--> Processing Dependency: libsmbclient = 4.10.16-20.el7_9 for package: samba-client-4.10.16-20.el7_9.x86_64
---> Package samba-common.noarch 0:4.10.16-9.el7_9 will be updated
---> Package samba-common.noarch 0:4.10.16-20.el7_9 will be an update
--> Running transaction check
---> Package audit-libs-python.x86_64 0:2.8.5-4.el7 will be installed
---> Package checkpolicy.x86_64 0:2.5-8.el7 will be installed
---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be installed
---> Package libsmbclient.x86_64 0:4.10.16-9.el7_9 will be updated
---> Package libsmbclient.x86_64 0:4.10.16-20.el7_9 will be an update
---> Package libwbclient.x86_64 0:4.10.16-9.el7_9 will be updated
---> Package libwbclient.x86_64 0:4.10.16-20.el7_9 will be an update
---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
---> Package samba-client-libs.x86_64 0:4.10.16-9.el7_9 will be updated
---> Package samba-client-libs.x86_64 0:4.10.16-20.el7_9 will be an update
---> Package samba-common-libs.x86_64 0:4.10.16-9.el7_9 will be updated
---> Package samba-common-libs.x86_64 0:4.10.16-20.el7_9 will be an update
---> Package samba-common-tools.x86_64 0:4.10.16-9.el7_9 will be updated
---> Package samba-common-tools.x86_64 0:4.10.16-20.el7_9 will be an update
---> Package samba-libs.x86_64 0:4.10.16-9.el7_9 will be updated
---> Package samba-libs.x86_64 0:4.10.16-20.el7_9 will be an update
---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================================================================================
Installing:
policycoreutils-python x86_64 2.5-34.el7 base 457 k
Updating:
samba x86_64 4.10.16-20.el7_9 updates 720 k
samba-client x86_64 4.10.16-20.el7_9 updates 647 k
samba-common noarch 4.10.16-20.el7_9 updates 216 k
Installing for dependencies:
audit-libs-python x86_64 2.8.5-4.el7 base 76 k
checkpolicy x86_64 2.5-8.el7 base 295 k
libsemanage-python x86_64 2.5-14.el7 base 113 k
python-IPy noarch 0.75-6.el7 base 32 k
setools-libs x86_64 3.3.8-4.el7 base 620 k
Updating for dependencies:
libsmbclient x86_64 4.10.16-20.el7_9 updates 146 k
libwbclient x86_64 4.10.16-20.el7_9 updates 117 k
samba-client-libs x86_64 4.10.16-20.el7_9 updates 5.0 M
samba-common-libs x86_64 4.10.16-20.el7_9 updates 183 k
samba-common-tools x86_64 4.10.16-20.el7_9 updates 467 k
samba-libs x86_64 4.10.16-20.el7_9 updates 271 k

Transaction Summary
=========================================================================================================================================================================================================================================
Install 1 Package (+5 Dependent packages)
Upgrade 3 Packages (+6 Dependent packages)

Total download size: 9.3 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/15): checkpolicy-2.5-8.el7.x86_64.rpm | 295 kB 00:00:00
(2/15): libsmbclient-4.10.16-20.el7_9.x86_64.rpm | 146 kB 00:00:00
(3/15): libwbclient-4.10.16-20.el7_9.x86_64.rpm | 117 kB 00:00:00
(4/15): audit-libs-python-2.8.5-4.el7.x86_64.rpm | 76 kB 00:00:00
(5/15): libsemanage-python-2.5-14.el7.x86_64.rpm | 113 kB 00:00:00
(6/15): policycoreutils-python-2.5-34.el7.x86_64.rpm | 457 kB 00:00:00
(7/15): python-IPy-0.75-6.el7.noarch.rpm | 32 kB 00:00:00
(8/15): samba-4.10.16-20.el7_9.x86_64.rpm | 720 kB 00:00:00
(9/15): samba-client-4.10.16-20.el7_9.x86_64.rpm | 647 kB 00:00:00
(10/15): samba-common-4.10.16-20.el7_9.noarch.rpm | 216 kB 00:00:00
(11/15): samba-client-libs-4.10.16-20.el7_9.x86_64.rpm | 5.0 MB 00:00:00
(12/15): samba-common-libs-4.10.16-20.el7_9.x86_64.rpm | 183 kB 00:00:00
(13/15): samba-common-tools-4.10.16-20.el7_9.x86_64.rpm | 467 kB 00:00:00
(14/15): samba-libs-4.10.16-20.el7_9.x86_64.rpm | 271 kB 00:00:00
(15/15): setools-libs-3.3.8-4.el7.x86_64.rpm | 620 kB 00:00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 6.1 MB/s | 9.3 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : samba-common-4.10.16-20.el7_9.noarch 1/24
Updating : libwbclient-4.10.16-20.el7_9.x86_64 2/24
Updating : samba-client-libs-4.10.16-20.el7_9.x86_64 3/24
Updating : samba-common-libs-4.10.16-20.el7_9.x86_64 4/24
Updating : samba-libs-4.10.16-20.el7_9.x86_64 5/24
Updating : samba-common-tools-4.10.16-20.el7_9.x86_64 6/24
Updating : libsmbclient-4.10.16-20.el7_9.x86_64 7/24
Installing : audit-libs-python-2.8.5-4.el7.x86_64 8/24
Installing : libsemanage-python-2.5-14.el7.x86_64 9/24
Installing : setools-libs-3.3.8-4.el7.x86_64 10/24
Installing : python-IPy-0.75-6.el7.noarch 11/24
Installing : checkpolicy-2.5-8.el7.x86_64 12/24
Installing : policycoreutils-python-2.5-34.el7.x86_64 13/24
Updating : samba-client-4.10.16-20.el7_9.x86_64 14/24
Updating : samba-4.10.16-20.el7_9.x86_64 15/24
Cleanup : samba-client-4.10.16-9.el7_9.x86_64 16/24
Cleanup : samba-4.10.16-9.el7_9.x86_64 17/24
Cleanup : samba-common-tools-4.10.16-9.el7_9.x86_64 18/24
Cleanup : libsmbclient-4.10.16-9.el7_9.x86_64 19/24
Cleanup : samba-libs-4.10.16-9.el7_9.x86_64 20/24
Cleanup : libwbclient-4.10.16-9.el7_9.x86_64 21/24
Cleanup : samba-client-libs-4.10.16-9.el7_9.x86_64 22/24
Cleanup : samba-common-libs-4.10.16-9.el7_9.x86_64 23/24
Cleanup : samba-common-4.10.16-9.el7_9.noarch 24/24
Verifying : samba-client-4.10.16-20.el7_9.x86_64 1/24
Verifying : checkpolicy-2.5-8.el7.x86_64 2/24
Verifying : samba-common-libs-4.10.16-20.el7_9.x86_64 3/24
Verifying : python-IPy-0.75-6.el7.noarch 4/24
Verifying : samba-common-4.10.16-20.el7_9.noarch 5/24
Verifying : policycoreutils-python-2.5-34.el7.x86_64 6/24
Verifying : setools-libs-3.3.8-4.el7.x86_64 7/24
Verifying : libsmbclient-4.10.16-20.el7_9.x86_64 8/24
Verifying : libsemanage-python-2.5-14.el7.x86_64 9/24
Verifying : libwbclient-4.10.16-20.el7_9.x86_64 10/24
Verifying : samba-libs-4.10.16-20.el7_9.x86_64 11/24
Verifying : audit-libs-python-2.8.5-4.el7.x86_64 12/24
Verifying : samba-client-libs-4.10.16-20.el7_9.x86_64 13/24
Verifying : samba-common-tools-4.10.16-20.el7_9.x86_64 14/24
Verifying : samba-4.10.16-20.el7_9.x86_64 15/24
Verifying : samba-common-4.10.16-9.el7_9.noarch 16/24
Verifying : libwbclient-4.10.16-9.el7_9.x86_64 17/24
Verifying : samba-libs-4.10.16-9.el7_9.x86_64 18/24
Verifying : samba-client-libs-4.10.16-9.el7_9.x86_64 19/24
Verifying : samba-common-tools-4.10.16-9.el7_9.x86_64 20/24
Verifying : samba-client-4.10.16-9.el7_9.x86_64 21/24
Verifying : samba-4.10.16-9.el7_9.x86_64 22/24
Verifying : libsmbclient-4.10.16-9.el7_9.x86_64 23/24
Verifying : samba-common-libs-4.10.16-9.el7_9.x86_64 24/24

Installed:
policycoreutils-python.x86_64 0:2.5-34.el7

Dependency Installed:
audit-libs-python.x86_64 0:2.8.5-4.el7 checkpolicy.x86_64 0:2.5-8.el7 libsemanage-python.x86_64 0:2.5-14.el7 python-IPy.noarch 0:0.75-6.el7 setools-libs.x86_64 0:3.3.8-4.el7

Updated:
samba.x86_64 0:4.10.16-20.el7_9 samba-client.x86_64 0:4.10.16-20.el7_9 samba-common.noarch 0:4.10.16-20.el7_9

Dependency Updated:
libsmbclient.x86_64 0:4.10.16-20.el7_9 libwbclient.x86_64 0:4.10.16-20.el7_9 samba-client-libs.x86_64 0:4.10.16-20.el7_9 samba-common-libs.x86_64 0:4.10.16-20.el7_9 samba-common-tools.x86_64 0:4.10.16-20.el7_9
samba-libs.x86_64 0:4.10.16-20.el7_9

Complete!

STEP 2) Configure samba server CentOS 7 for the purpose of using it in IPMI Virtual share.
We are going to use a share without login credentials, because our KVM IP are always local ones and accessed via a vpn network and in addition only the network of the IPMI IPs could access the share (the samba server has a firewall configured).
Set the configuration file of the samba server – one directory storing the files shared with no login credentials (no username/password means anonymous login).
The configuration file is:

nano /etc/samba/smb.conf
[global]
workgroup = WINSHARE
server string = Samba Server %v
netbios name = centossrv
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ==============================
[share]
path = /home/iso
browsable =yes
writable = no
guest ok = yes
read only = yes

As you can see we use “/mnt/storage1/samba” for our directory where the ISO files will be located. Change this path if you want to put your ISO files somewhere else.
Set the right permissions for the directory and selinux (if you server is not selinux enabled, you could skip the selinux part) and run the samba daemon:

mkdir /home/iso
chown -R nobody:nobody /home/iso
semanage fcontext -a -t samba_share_t '/home/iso(/.*)?'
restorecon -Rv /home/iso

restorecon reset /home/iso context unconfined_u:object_r:unlabeled_t:s0->unconfined_u:object_r:samba_share_t:s0

 

cd /home/iso/
wget https://mirror.yandex.ru/almalinux/9.1/isos/x86_64/AlmaLinux-9.1-x86_64-minimal.iso

chown nobody:nobody AlmaLinux-9.1-x86_64-minimal.iso
systemctl start smb
systemctl status smb

 

[root@srv0 samba]# firewall-cmd –new-zone=smbshare –permanent
success
[root@srv0 samba]# firewall-cmd –zone=smbshare –add-source=192.168.7.0/24 –permanent
success
[root@srv0 samba]# firewall-cmd –zone=smbshare –add-service=samba –permanent
success
[root@srv0 samba]# firewall-cmd –zone=smbshare –add-service=samba-client –permanent
success
[root@srv00 samba]# firewall-cmd –reload
success
[root@srv00 samba]# firewall-cmd –zone=smbshare –list-all
smbshare (active)
target: default
icmp-block-inversion: no
interfaces:
sources: 192.168.7.0/24
services: samba samba-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

[root@srv00 samba]#
STEP 3) Mount a disk in IPMI Virutal Media and boot from it
You could check our additional tutorial for it here –

STEP 3.1) Fill “Share host” and “Path image” only, because we configured our samba share without a password
main menu
Image on Windows Share
STEP 3.2) Upon a successful configuration saving you’ll get a confirmation dialog.
If no confirmation is shown you would not be able to mount the share, check out our Troubleshooting below!
main menu
Save configuration of Image on Windows Share
STEP 3.3) After saving the configuration click on “Mount” to load your ISO file in the virtual CD-ROM.
main menu
Mount Image on Windows Share
STEP 3.4) This dialog is always shown no matter there is such share or not: “Please check the device status to confirm whether the image is mounted/unmounted.”
main menu
Check device status
STEP 3.5) If the Supermicro IPMI accessed successfully the share resource it would mount it (load the ISO file as s CD in the virtual CD-ROM).
If not the three Device 1,2,3 will show the same: “No disk emulation set.”, which means the samba share is not accessible, check the permissions for the file and the firewall first (and the logs files, too).
main menu
There is an iso file mounted
* Troubleshooting
– if you click on button “Save” and just nothing happen – no dialog for successful saving and no dialog at all, probably there is a Javascript error, try to open the web interface from a different browser with clean history or click ctrl+F5 when loading the Virtual Media page! More in Cannot save and mount a Supermicro IPMI Virtual media mount – javascript error?

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Этот сайт использует Akismet для борьбы со спамом. Узнайте, как обрабатываются ваши данные комментариев.