TWiki
>
DICE Web
>
ManagedPlatformUnit
>
SimpleKVMDocs
>
SimpleKVMGuests
>
WalkthroughKVMguest
(revision 11) (raw view)
Edit
Attach
---++!! Example walkthrough of KVM guest creation %TOC% ---+++ Create LCFG profile A sample KVM guest profile :- <verbatim> /* circlevm1.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_at1.h> dhclient.mac 00:16:3E:ee:23:4E </verbatim> _Notes:_ <ol> <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. <li>If the wire you require for your guest isn't the default for the host server, you will need to specify the --bridge option to kvmtool when creating the guest </ol> ---+++ Create KVM guest using kvmtool The following will create a KVM guest called "circlevm20" on the KVM host "circle" 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. <verbatim> [zip]ascobie: kvmtool create --host circle --name circlevm20 MAC address is 00:16:3E:ee:23:49 Creating image file (this may take some time) ...Vol circlevm20 created Registering machine [zip]ascobie: </verbatim> 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 circlevm11 --console Domain circlevm11 started Connected to domain circlevm11 Escape character is ^] </verbatim> (usual output for rest of install) ---+++ Possible problems 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 circlevm11 --bootorder "network,hd" </verbatim>
Edit
|
Attach
|
P
rint version
|
H
istory
:
r14
<
r13
<
r12
<
r11
<
r10
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r11 - 27 Apr 2020 - 09:19:16 -
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