TWiki
>
DICE Web
>
ManagedPlatformUnit
>
SimpleKVMDocs
>
SimpleKVMGuests
>
WalkthroughKVMguest
(27 Apr 2020,
ChrisCooke
)
(raw view)
E
dit
A
ttach
---++!! Example walkthrough of KVM guest creation %TOC% ---+++ Create LCFG profile A sample KVM guest profile :- <verbatim> /* fargovm1.inf.ed.ac.uk */ #define FIRST_INSTALL #include <dice/os/sl7.h> #include <dice/hw/kvm.h> #include <dice/options/small-server.h> #include <dice/options/serialconsole.h> #include <live/wire_s32.h> dhclient.mac 00:16:3E:ee:23:4E </verbatim> ---+++ Create KVM guest using kvmtool The following will create a KVM guest called "fargovm20" on the KVM host "fargo" for running SL7. The guest will have a virtual disk of 20GB (default size) and the default allocation of main memory (currently 4GB). kvmtool will auto-generate (and display) a MAC address for the guest. <pre> [zip]ascobie: kvmtool create --host fargo --name fargovm20 --bridge <em>(as appropriate - see notes below)</em> MAC address is 00:16:3E:ee:23:49 Creating image file (this may take some time) ...Vol fargovm20 created Registering machine [zip]ascobie: </pre> Remember to copy the generated MAC address into your KVM guest's LCFG profile. ---+++ Install the KVM guest Note that the escape (to the shell) character is ^] <verbatim> [zip]ascobie: kvmtool start --name fargovm11 --console Domain fargovm11 started Connected to domain fargovm11 Escape character is ^] </verbatim> (usual output for rest of install) ---+++ Notes <ol> <li>If the wire which your guest will use is not the same as its KVM server's default wire, remember to specify the ==--bridge== option to ==kvmtool== when creating the guest. If you don't, there will be a mismatch between the wire the guest wants, and the wire it gets. <li>Don't just cut and paste the sample profile above - remember to use the correct live/wire header, for example. <li>The =small-server.h= header shrinks the root partition to 10GB, and /var/cache/afs to 2GB. This means that for guests with 4GB of allocated main memory, a disk of 20GB is sufficient (this is kvmtool's default disk size). <li> =FIRST_INSTALL= is definitely necessary for the first install of a VM: without it, you'll get the error <verbatim> [INFO] install: Calling fstab preparedisks /root [FAIL] fstab: device node /dev/vda1 does not exist (udev problem?) [FAIL] install: install method failed sh-4.1# </verbatim> The define should be removed after the first installation. </ol> ---+++ Possible problems ---++++ You start up the VM, but get no output. You may have got the networking wrong. Does the wire file you've included in the profile match the wire which the machine is using in the DNS? And did you remember to specify this with the ==--bridge== option in the ==kvmtool create== command line? (You can miss out the ==--bridge== option if your VM is on that KVM server's default wire - but if it's not, you must use ==--bridge==.) ---++++ The install fails, but attempts to boot off disk instead of PXE The default boot order for a KVM guest is "hd,network" (ie disk,PXE). At the initial install, there is no bootloader on the disk so the KVM BIOS skips to booting from PXE. If an install fails once the disk has been partitioned (?), subsequent boots will hang on booting off the disk and the BIOS won' skip to PXE. The solution to this is to temporarily change the bootorder for the KVM guest to "network,hd" :- <verbatim> kvmtool setbootorder --host circle --name fargovm11 --bootorder "network,hd" </verbatim>
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r14
<
r13
<
r12
<
r11
<
r10
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r14 - 27 Apr 2020 - 14:33:09 -
ChrisCooke
DICE
DICE Web
DICE Wiki Home
Changes
Index
Search
Meetings
CEG
Operational
Computing Projects
Technical Discussion
Units
Infrastructure
Managed Platform
Research & Teaching
Services
User Support
Other
Service Catalogue
Platform upgrades
Procurement
Historical interest
Emergencies
Critical shutdown
Where's my software?
Pandemic planning
This is
WebLeftBar
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback
This Wiki uses
Cookies