(Fix instructions for using cloud image) |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 16: | Line 16: | ||
If you don't have an existing disk image, but still want to run the test, you can use a Fedora cloud image | If you don't have an existing disk image, but still want to run the test, you can use a Fedora cloud image | ||
* Install virt-customize with: <code> | * Install virt-customize with: <code>dnf install libguestfs-tools-c</code> | ||
* <code>wget https:// | * <code>wget https://kojipkgs.fedoraproject.org/compose/branched/Fedora-29-20180910.n.0/compose/Cloud/x86_64/images/Fedora-Cloud-Base-29-20180910.n.0.x86_64.qcow2</code> | ||
* Set the root password to '123456' with: <code> virt-customize --add Fedora-Cloud-Base- | * Set the root password to '123456' with: <code> virt-customize --add Fedora-Cloud-Base-29-20180910.n.0.x86_64.qcow2 --root-password password:123456</code> | ||
** This is not secure, but should be fine for test purposes. | ** This is not secure, but should be fine for test purposes. | ||
* Disable cloud-init, since it hangs waiting for input: <code> virt-customize --add Fedora-Cloud-Base- | * Disable cloud-init, since it hangs waiting for input: <code> virt-customize --add Fedora-Cloud-Base-29-20180910.n.0.x86_64.qcow2 --run-command "systemctl mask cloud-init.service" </code> | ||
==== virt-builder pre-installed image ==== | ==== virt-builder pre-installed image ==== | ||
Line 26: | Line 26: | ||
* Install virt-builder with: <code>yum install libguestfs-tools-c</code> | * Install virt-builder with: <code>yum install libguestfs-tools-c</code> | ||
* Use <code>virt-builder --list</code> to see the available distro images. We will use fedora- | * Use <code>virt-builder --list</code> to see the available distro images. We will use fedora-28 | ||
* Download the image and set the root password to '123456': <code>virt-builder fedora- | * Download the image and set the root password to '123456': <code>virt-builder fedora-28 --root-password password:123456</code> | ||
=== virt-manager === | === virt-manager === | ||
{{admon/note | No Fedora 29 os selection is available, please use the Fedora 28 option}} | |||
# Run virt-manager (should autoconnect to qemu) | # Run virt-manager (should autoconnect to qemu) | ||
# Launch the 'New VM' wizard | # Launch the 'New VM' wizard | ||
Line 45: | Line 48: | ||
sudo virt-install --name test-day-vm --ram 2048 \ | sudo virt-install --name test-day-vm --ram 2048 \ | ||
--disk /path/to/my/existing/vm/disk.img \ | --disk /path/to/my/existing/vm/disk.img \ | ||
--os-variant | --os-variant fedora28 \ | ||
--import | --import | ||
Latest revision as of 17:49, 10 September 2018
Description
Import an existing VM disk image.
Setup
Initial test day setup, a pre-existing VM image.
How to test
Ready your disk image
Personal pre-existing disk image
For this test we want to be sure that all sorts of disk images will import and run correctly, so please consider using any existing disk image you have.
Fedora cloud image
If you don't have an existing disk image, but still want to run the test, you can use a Fedora cloud image
- Install virt-customize with:
dnf install libguestfs-tools-c
wget https://kojipkgs.fedoraproject.org/compose/branched/Fedora-29-20180910.n.0/compose/Cloud/x86_64/images/Fedora-Cloud-Base-29-20180910.n.0.x86_64.qcow2
- Set the root password to '123456' with:
virt-customize --add Fedora-Cloud-Base-29-20180910.n.0.x86_64.qcow2 --root-password password:123456
- This is not secure, but should be fine for test purposes.
- Disable cloud-init, since it hangs waiting for input:
virt-customize --add Fedora-Cloud-Base-29-20180910.n.0.x86_64.qcow2 --run-command "systemctl mask cloud-init.service"
virt-builder pre-installed image
virt-builder is a new tool that can download pre-installed minimal images for a variety of distros.
- Install virt-builder with:
yum install libguestfs-tools-c
- Use
virt-builder --list
to see the available distro images. We will use fedora-28 - Download the image and set the root password to '123456':
virt-builder fedora-28 --root-password password:123456
virt-manager
- Run virt-manager (should autoconnect to qemu)
- Launch the 'New VM' wizard
- Choose the 'Import' option
- Browse to the existing VM image.
- Make sure to enter a valid OS type, it's important for performance defaults.
- Proceed with through the wizard, using the default suggested values.
- On the final page, use the VM name: test-day-vm
- Finish the install, verify your VM boots as expected. Depending on the OS and content of the image, additional devices may need to be configured in the 'customize before install' step.
virt-install
An example virt-install invocation looks like
sudo virt-install --name test-day-vm --ram 2048 \ --disk /path/to/my/existing/vm/disk.img \ --os-variant fedora28 \ --import
Expected Results
Guest installations start and perform without any issues. Guest is bootable after install completes.