305-300 practice question 3 of 15

A clone of a previously used virtual machine should be created. All VM specific information, such as user accounts, shell histories and SSH host keys should be removed from the cloned disk image. Which of the following tools can perform these tasks?

Full set: 121 questions
Answer options
A: virc-reset
B: virt-sparsi
C: virt-rescue
D: virt-svspre Correct answer
E: sysprep
F: vire-wipe
Correct Answer:
D. virt-svspre
Explanation

virt-sysprep is a command-line tool from the libguestfs-tools package designed specifically to reset or "un-configure" a virtual machine's disk image to prepare it for cloning. It performs a series of modular operations to create a generic "template" image. These operations include removing machine-specific information such as SSH host keys, user accounts, persistent network configurations, and shell histories. This ensures that new virtual machines cloned from this image will start in a clean state, ready for their own unique configuration, without inheriting sensitive or specific data from the original VM.

Why Incorrect

A. virc-reset is not a standard, recognized command within the libvirt or libguestfs tool suites. It is likely a typographical error or a fabricated name.
B. virt-sparsify is a tool used to make a disk image sparse. It reclaims free space within the image file but does not alter or remove user data or system configuration.
C. virt-rescue provides a rescue shell for a virtual machine. It is used for manual troubleshooting and repair, not for automated sanitization for cloning purposes.
E. sysprep is the Microsoft System Preparation Tool. It performs a similar function but is exclusively for preparing Windows operating systems for imaging, not for general or Linux VMs.
F. virt-wipe is a tool for securely erasing data from a virtual disk to make it unrecoverable. Its purpose is data destruction, not preparing an image for reuse as a template. ---

References

1. Red Hat Enterprise Linux 8 Documentation: In the "Managing virtual machines with libguestfs-tools" section, virt-sysprep is described as the tool to "Reset a VM to a golden state before creating a clone of it." It lists operations such as removing SSH host keys and user accounts.

Source: Red Hat Customer Portal, Configuring and managing virtualization, Chapter 16. Libguestfs tools, Section 16.8. Resetting a VM to a golden state with virt-sysprep.

2. Libguestfs Official Documentation (Man Page): The manual page for virt-sysprep explicitly states its purpose: "virt-sysprep can reset or unconfigure a virtual machine so that clones can be made from it." It details the available operations, including --operations ssh-hostkeys,user-account,bash-history, which directly correspond to the tasks mentioned in the question.

Source: virt-sysprep(1) — Linux man page. Available from the libguestfs project website or system man pages.

3. University of Edinburgh, School of Informatics Courseware: Materials for the "System Design and Programming" course describe virt-sysprep as a crucial tool for creating VM templates. It is explained as the method to "generalize the VM by removing any host-specific information (e.g. SSH keys, MAC addresses, etc.)".

Source: University of Edinburgh, School of Informatics, Virtualisation using KVM, Section on "Creating VM Templates".

Scroll to Top