Установка гипервизора KVM

Установка гипервизора KVM представляет из себя простую задачу. Тем не менее, она отличается на разных версиях Debian и не помешает лишний раз сделать себе пару заметок, а кроме этого рассмотреть и базовую настройку для минимальной готовности окружения.


Если вам интересна тематика Debian и связанных с ним приложений, рекомендую обратиться к тегу Debian на моем блоге.


Установка гипервизора KVM

Не забудьте ознакомиться с системными требованиями. Это можно сделать например из официальной документации Redhat по виртуализации 1. Конечно RHV немного другой продукт, но основан он на все том же KVM, а лучше документации вам просто не найти.

Также проверьте аппаратную поддержку виртуализации на вашем оборудовании:

Если возвращает отличное от 0 значение, значит все хорошо.

Установка

Ставим на Debian 9 2:

Примечание: для предыдущих версий ОС список пакетов будет отличаться

apt-get install qemu-kvm libvirt-bin bridge-utils virtinst.

Подробнее о пакетах:

  • qemu-kvm — сам гипервизор;
  • libvirt-clients — набор библиотек для взаимодействия с гипервизором;
  • libvirt-daemon-system — демон libvirtd;
  • virtinst — инструменты и библиотеки для управления виртуальными машинами;
  • bridge-utils — для организации сети для виртуальных машин.

После установки место на диске уменьшится на 120-650МБ в зависимости от дистрибутива ОС.

Проверка

Пришло время проверить корректность выполненных выше операций. Первым делом убедимся загружены ли модули KVM в ядре:

Вывод должен иметь примерно такой вид:

Также через virsh — одну из основных утилит администрирования KVM — можно получить сводку по состоянию оборудования:

Вывод команды сокращен:

Если все ОК, идем дальше.

Б — безопасность

Пока что ни слова не было сказано о безопасности. Предполагается, что все операции с виртуальными машинами будут выполняться из под учетной записи суперпользователя, что не совсем правильно.

Примечание: стоит оговориться, что вариант работы поз под root полностью приемлем для тестового окружения, но не для продакшена.

Взаимодействие с KVM осуществляется через библиотеку libvirt (которая, помимо всего прочего, умеет общаться и с другими гипервизорами, но это уже из другой оперы). Чтобы предоставить права рядовому пользователю, достаточно добавить его в группы kvm и libvirt, что мы и сделаем:

Где bq — рядовой юзер на моем тестовом сервере. Если пользователь ещё не был создан, исправляем это и сразу выставляем ему пароль:

Далее открываем конфиг для редактирования:

Изменяем параметры:

Где bq — соответственно новый пользователь и группа. Перезапускаем демона:

Переходим к следующему этапу.

Хранилище

К задачам начальной настройки также относится процесс подготовки хранилища данных виртуальных машин.

Примечание: В данном случае моим выбором будет хранилище на основе директорий 3, но вы можете использовать различные варианты, в том числе основанные на дисках 4, разделах 5, томах LVM 6 и др 7.. Для получения более подробной информации читайте руководство Virtualization Deployment and Administration Guide от Redhat. Оно даст вам наиболее полное представление о KVM.

Под новым пользователем создаем нужную папку, сразу назначив необходимые права:

Определяем пул:

Проверим что у нас получилось:

Запускаем пул:

Активируем автозапуск пула:

Осталось только посмотреть что в итоге получилось:

Пример свойств пула на моем тестовом сервере:

Настройка хранилища завершена.

Базовая настройка сети

Функционал виртуальной сети положен на сторонний софт, а именно на bridge-utils, о котором я упоминал выше. Напомню, что гипервизор отвечает лишь за управление ресурсами CPU и RAM.

В статье Установка гипервизора Xen я уже рассказывал про настройку сети, но не будет лишним напомнить об этом важном моменте ещё раз.

Предположим сетевые настройки выглядят следующим образом:

С конфигурацией моста настройки примут следующий вид:

Перезапускаем демона (либо перезагрузите сервер, чтобы убедиться в нормальном функционировании конфигурации при старте):

Примечание: если вы сделали какие-либо ошибки в сетевых настройках, то вы можете потерять подключение к серверу. В этом случае неплохо либо находиться недалеко от сервера, либо иметь к нему удаленную консоль, не завязанную на основном сетевом подключении (например ipmi).

Различные варианты настройки моста доступны в официальной документации 8, а у меня на этом все.

Можно переходить к созданию первых виртуальных машин.

comments powered by HyperComments
2conclusion
2022-06-17 22:30:12
<strong>3whitsuntide</strong>
nursing dissertation help
2022-07-05 18:59:42
<strong>dissertation help https://professionaldissertationwriting.com/</strong>
dissertation chapters
2022-07-05 21:26:31
<strong>buy dissertation https://helpwithdissertationwritinglondon.com/</strong>
search writing help
2022-07-05 23:41:40
<strong>dissertation defense https://dissertationwritingcenter.com/</strong>
mathematics dissertation help
2022-07-06 00:51:41
<strong>uk dissertation writing help online https://dissertationhelpexpert.com/</strong>
dissertation editing
2022-07-06 03:47:26
<strong>phd dissertation peer reviewing help https://accountingdissertationhelp.com/</strong>
dissertation writing software
2022-07-06 06:46:40
<strong>books and dissertation about mafa people https://examplesofdissertation.com/</strong>
writing a dissertation
2022-07-06 09:27:02
<strong>dissertation vs thesis https://writing-a-dissertation.net/</strong>
dissertation help
2022-07-06 12:54:33
<strong>dissertation proposal sample https://bestdissertationwritingservice.net/</strong>
dissertation services
2022-07-06 14:20:26
<strong>dissertation title examples https://businessdissertationhelp.com/</strong>
dissertation online help
2022-07-06 18:09:20
<strong>uf dissertation award https://customdissertationwritinghelp.com/</strong>
writing a proposal for your dissertation
2022-07-06 21:36:42
<strong>dissertation help galway https://writingadissertationproposal.com/</strong>
writing a master's dissertation
2022-07-06 23:05:33
<strong>dissertation editing https://dissertationhelpspecialist.com/</strong>
phd dissertation
2022-07-07 03:20:21
<strong>dissertation write up https://dissertationhelperhub.com/</strong>
writing papers
2022-07-07 07:26:04
<strong>writing an abstract for a dissertation https://customthesiswritingservices.com/</strong>
reddit online casino
2022-07-25 19:49:37
<strong>ocean online casino app https://download-casino-slots.com/</strong>
online casino testen
2022-07-25 22:32:25
<strong>wind creek online casino real money https://firstonlinecasino.org/</strong>
beat online casino
2022-07-26 01:08:32
<strong>best paying online casino https://onlinecasinofortunes.com/</strong>
online casino real money usa no deposit
2022-07-26 01:40:41
<strong>atlantic city online casino https://newlasvegascasinos.com/</strong>
rivers casino online
2022-07-26 08:12:30
<strong>nj online casino https://onlinecasinosdirectory.org/</strong>
online casino bookie franchise reviews
2022-07-26 09:08:38
<strong>virgin casino online https://9lineslotscasino.com/</strong>
online casino min deposit
2022-07-26 11:56:01
<strong>turning stone online casino login https://free-online-casinos.net/</strong>
admiral club casino online
2022-07-26 14:06:48
<strong>no deposit bonus win real money online casino for free https://internet-casinos-online.net/</strong>
rsweeps online casino
2022-07-26 17:23:54
<strong>online real money casino https://cybertimeonlinecasino.com/</strong>
hollywood casino online
2022-07-26 19:38:46
<strong>lotus casino online https://1freeslotscasino.com/</strong>
vegas casino online no deposit bonus
2022-07-27 03:22:32
<strong>casino online sin deposito https://casino-online-jackpot.com/</strong>
online casino baccarat
2022-07-27 08:10:13
<strong>casino in gta 5 online https://onlineplayerscasino.com/</strong>
win real money online casino for free
2022-07-27 11:58:13
<strong>online casino no deposit bonus codes 2020 https://all-online-casino-games.com/</strong>
borgata online casino customer service
2022-07-27 15:20:59
<strong>best online casino games https://casino8online.com/</strong>
secure vpn
2022-08-07 16:03:26
<strong>best vpn for japan https://freevpnconnection.com/</strong>
free vpn download
2022-08-07 18:02:59
<strong>top rated vpn service https://shiva-vpn.com/</strong>
best countries for vpn
2022-08-07 19:10:56
<strong>free vpn germany https://freehostingvpn.com/</strong>
ipvanish vpn
2022-08-07 22:42:56
<strong>get us vpn service https://ippowervpn.net/</strong>
how to buy a vpn server
2022-08-08 01:25:44
<strong>free vpn ip address https://imfreevpn.net/</strong>
best vpn service of 2022
2022-08-08 02:22:07
<strong>vpn for free https://superfreevpn.net/</strong>
best vpn service review
2022-08-08 05:47:20
<strong>buy vpn now https://free-vpn-proxy.com/</strong>
uf health vpn
2022-08-08 08:25:03
<strong>best vpn australia https://rsvpnorthvalley.com/</strong>
gay dating sites that work
2022-08-23 16:07:19
<strong>free discreet gay dating site https://gayedating.com/</strong>
gay dating games
2022-08-23 19:31:48
<strong>triad gay dating sites https://datinggayservices.com/</strong>
best online dating service
2022-08-24 12:23:13
<strong>free datings site https://freephotodating.com/</strong>
plenty fish date site
2022-08-24 14:52:04
<strong>asian dating chat https://onlinedatingbabes.com/</strong>
online dating online dating
2022-08-24 17:52:42
<strong>good dating sites free https://adult-singles-online-dating.com/</strong>
free app for online meeting
2022-08-24 22:30:17
<strong>zoosk login https://online-internet-dating.net/</strong>
pof dating app
2022-08-25 02:33:33
<strong>local dating sites https://datingpersonalsonline.com/</strong>
meet woman
2022-08-25 08:06:35
<strong>youwu666 https://lavaonlinedating.com/</strong>
tinder gratis
2022-08-25 10:37:39
<strong>hinge dating https://freeadultdatingpasses.com/</strong>
interracial dating central
2022-08-25 12:48:06
<strong>free date https://virtual-online-dating-service.com/</strong>
chatting dating site
2022-08-25 14:58:42
<strong>free gay dating sites chat https://zonlinedating.com/</strong>
free site dating
2022-08-25 15:40:35
<strong>online free dating sites https://onlinedatingservicesecrets.com/</strong>
online casino live
2022-08-30 09:38:22
<strong>best us online casino https://onlinecasinos4me.com/</strong>
casino game online
2022-08-30 15:32:22
<strong>tropicana online casino nj https://online2casino.com/</strong>
online casino game real money
2022-08-30 19:45:30
<strong>nj casino online sites https://casinosonlinex.com/</strong>
google zoom gay chat room
2022-09-03 01:00:09
<strong>1-800 contacts refined gay men chat https://newgaychat.com/</strong>
gay skype chat room
2022-09-03 04:42:01
<strong>gay couple on chat video https://gaychatcams.net/</strong>
random gay chat cams
2022-09-03 12:17:24
<strong>gay chat site https://gaychatspots.com/</strong>
chat cam gay random
2022-09-03 17:54:10
<strong>gay couple on chat video https://gay-live-chat.net/</strong>
gay chicago webcam chat
2022-09-03 20:03:46
<strong>gay webcam and chat https://chatcongays.com/</strong>
free gay chat fcn
2022-09-04 02:01:34
<strong>chat aveneu gay https://gayphillychat.com/</strong>
free gay chat line
2022-09-04 06:46:04
<strong>gay chat webcam https://gaychatnorules.com/</strong>
gay zoom webcam chat
2022-09-04 10:18:36
<strong>senior gay chat lines https://gaymusclechatrooms.com/</strong>
gay chat randome
2022-09-04 18:29:53
<strong>gay discord chat https://free-gay-sex-chat.com/</strong>
gay page chat roulette
2022-09-04 20:45:56
<strong>gay chat room upstate sc https://gayinteracialchat.com/</strong>
buy academic papers
2022-10-20 18:35:47
<strong>i will pay you to write my paper https://term-paper-help.org/</strong>
ghost writer college papers
2022-10-20 19:12:43
<strong>order custom paper https://sociologypapershelp.com/</strong>
help writing college papers
2022-10-20 21:50:19
<strong>help writing a paper for college https://paperwritinghq.com/</strong>
help with writing a paper for college
2022-10-21 01:36:00
<strong>can someone write my paper for me https://write-my-paper-for-me.org/</strong>
help on writing a paper
2022-10-21 03:39:54
<strong>what should i write my paper on https://top100custompapernapkins.com/</strong>
cheap custom papers
2022-10-21 05:17:58
<strong>paper writing company https://researchpaperswriting.org/</strong>
scientific paper writing services
2022-10-21 06:25:14
<strong>buy papers online cheap https://cheapcustompaper.org/</strong>
paper writer services
2022-10-21 07:51:15
<strong>custom papers online https://writingpaperservice.net/</strong>
help on writing a paper
2022-10-21 08:50:07
<strong>pay to write paper https://buyessaypaperz.com/</strong>
where can i find someone to write my paper
2022-10-21 11:35:13
<strong>order papers online https://writemypaperquick.com/</strong>
pay for paper
2022-10-21 13:45:34
<strong>cheap paper writing services https://essaybuypaper.com/</strong>
order a paper online
2022-10-21 16:04:42
<strong>where to buy resume paper https://premiumpapershelp.com/</strong>
paper help writing
2022-10-21 17:31:53
<strong>pay to write my paper https://ypaywallpapers.com/</strong>
1dudgeon
2023-01-27 00:10:22
<strong>2autograph</strong>
coursework uk
2023-02-05 14:54:10
<strong>online coursework https://brainycoursework.com/</strong>
do my coursework online
2023-02-05 16:32:26
<strong>data analysis coursework https://courseworkninja.com/</strong>
buy coursework
2023-02-05 17:45:09
<strong>do my coursework online https://writingacoursework.com/</strong>
2023-02-05 19:13:48
<strong>coursework info https://mycourseworkhelp.net/</strong>
do my coursework for me
2023-02-05 20:02:20
<strong>coursework website https://courseworkdownloads.com/</strong>
coursework moderation
2023-02-05 21:55:17
<strong>buy coursework https://courseworkinfotest.com/</strong>
coursework writing services
2023-02-05 22:58:46
<strong>creative writing coursework https://coursework-expert.com/</strong>
degree coursework
2023-02-06 00:27:05
<strong>data analysis coursework https://teachingcoursework.com/</strong>
coursework writing service uk
2023-02-06 01:50:46
<strong>coursework sample https://buycoursework.org/</strong>
coursework master
2023-02-06 03:04:40
<strong>do my coursework https://courseworkdomau.com/</strong>
dating naked
2023-02-08 12:25:11
<strong>totally free dating sites local https://freewebdating.net/</strong>
dating sifes
2023-02-08 16:20:28
<strong>datinghotlot https://free-dating-sites-free-personals.com/</strong>
free online
2023-02-08 18:57:01
<strong>best dating online website https://onlinedatingsurvey.com/</strong>
no email dating site
2023-02-08 19:52:55
<strong>dating app https://onlinedatingsuccessguide.com/</strong>
dating sites free
2023-02-08 21:50:18
<strong>fdating 100 free dating site free https://onlinedatinghunks.com/</strong>
local personals
2023-02-08 23:19:15
<strong>best dating apps https://datingwebsiteshopper.com/</strong>
Яндекс.Метрика