Example of an initial installation
The guest installation process depends on your product or distribution.
Procedure
-
For an initial installation, you need to provide installation files for the virtual server, such as an ISO image of the installation DVD, the
kernel image file, and the initial
ramdisk.
The name and the location of these files depend on your product, your distribution or your installation process.
You can either mount the ISO image containing the installation files during the guest installation process, copy the required files to the host file system, or connect to an FTP server.
-
Create a domain configuration-XML file.
-
If you intend to boot from an ISO image, the domain configuration-XML file should contain:
- The fully qualified path and filename of the ISO image.
- A persistent device configuration for the device that will contain the bootable installed guest.
Example:<domain> ... <os> ... </os> ... <devices> <emulator>/usr/bin/qemu-system-s390x</emulator> <!-- IPL device --> <controller type="scsi" model="virtio-scsi" index="4"/> <disk type="file" device="cdrom"> <driver name="qemu" type="raw" io="native" cache="none"/> <source file="/var/lib/libvirt/images/LinuxDVD1.iso"/> <target dev="sda" bus="scsi"/> <address type="drive" controller="4" bus="0" target="0" unit="0"/> <readonly/> <boot order="1"/> </disk> <!-- guest installation device --> <disk type="block" device="disk"> <driver name="qemu" type="raw" cache="none" io="native" iothread="1"/> <source dev="/dev/mapper/36005076305ffc1ae00000000000021d7"/> <target dev="vda" bus="virtio"/> </disk> <console type="pty"> <target type="sclp"/> </console> </devices> </domain>
-
If you intend to boot from a kernel image file and an initial ramdisk, the domain configuration-XML file should contain:
- The fully qualified path and filename of the kernel image.
- The fully qualified path and filename of the initial ramdisk.
- The kernel command-line parameters.
- A persistent device configuration for the device that will contain the bootable installed guest.
Example:<domain> ... <os> ... <!-- Boot kernel - remove 3 lines --> <!-- after a successful initial installation --> <initrd>initial-ramdisk</initrd> <kernel>kernel-image</kernel> <cmdline>command-line-parameters</cmdline> ... </os> ... <devices> <emulator>/usr/bin/qemu-system-s390x</emulator> <!-- guest installation device --> <disk type="block" device="disk"> <driver name="qemu" type="raw" cache="none" io="native" iothread="1"/> <source dev="/dev/mapper/36005076305ffc1ae00000000000021d7"/> <target dev="vda" bus="virtio"/> </disk> <console type="pty"> <target type="sclp"/> </console> </devices> </domain>
-
If you intend to boot from an ISO image, the domain configuration-XML file should contain:
- Start the virtual server for the initial installation.
- Install the guest as described in your distribution documentation.
-
When a bootable guest is installed, modify the
domain configuration-XML
using virsh edit to boot from the IPL disk containing the boot
record.
-
In case you installed the guest using the ISO
image:
Example:
<domain> ... <os> ... </os> ... <devices> <emulator>/usr/bin/qemu-system-s390x</emulator> <!-- IPL device --> <controller type="scsi" model="virtio-scsi" index="4"/> <disk type="file" device="cdrom"> <driver name="qemu" type="raw" io="native" cache="none"/> <source file="/var/lib/libvirt/images/LinuxDVD1.iso"/> <target dev="sda" bus="scsi"/> <address type="drive" controller="4" bus="0" target="0" unit="0"/> <readonly/> </disk> <!-- guest IPL disk --> <disk type="block" device="disk"> <driver name="qemu" type="raw" cache="none" io="native" iothread="1"/> <source dev="/dev/mapper/36005076305ffc1ae00000000000021d7"/> <target dev="vda" bus="virtio"/> <boot order="1"/> </disk> <console type="pty"> <target type="sclp"/> </console> </devices> </domain>
-
In case you installed the guest using the kernel
image and the initial ramdisk:
Example:
<domain> ... <os> ... </os> ... <devices> <emulator>/usr/bin/qemu-system-s390x</emulator> <!-- guest IPL disk --> <disk type="block" device="disk"> <driver name="qemu" type="raw" cache="none" io="native" iothread="1"/> <source dev="/dev/mapper/36005076305ffc1ae00000000000021d7"/> <target dev="vda" bus="virtio"/> <boot order="1"/> </disk> <console type="pty"> <target type="sclp"/> </console> </devices> </domain>
-
In case you installed the guest using the ISO
image:
- From now on, you can start the virtual server using this domain configuration-XML. The virtual server boots the installed guest from the IPL disk.