VMmanager: Administrator guide

Creating a disk image

A user image is a virtual machine disk image that is used for creating new virtual machines or as a backup copy. A VM image can be anonymized. When anonymizing, personal information is removed from the image: user data, settings, passwords, etc.

The platform does not support creating VM images with network operating systems (RouterOS, JUNOS, Cisco IOS, etc).
Image files are created in the image storage directory (by default — /image/). Before creating an image, make sure that there is enough free space on the partition with this directory.

Features of anonymized images

Unix

The user image is created using the virt-sysprep utility. The utility is run with the --operations defaults,ca-certificates,kerberos-data,user-account parameter. The following will be removed from the original VM:

  • /home/ directory;
  • /var/log/ directory;
  • manually created user accounts;
  • automatically generated error reports from the /var/spool/abrt/ directory;
  • *.bak and *~ backup files;
  • bash interpreter history;
  • data on block device identifiers from the /etc/blkid.tab file;
  • kexec-tools utility data;
  • cron jobs;
  • DHCP client and server databases;
  • Dovecot mail server data;
  • IPA data;
  • Kerberos data;
  • keytab file for Kerberos authentication;
  • unique identifier of the local system — machine ID;
  • emails from the local directory;
  • HOSTNAME and DHCP_HOSTNAME parameters from the network configuration;
  • MAC address information;
  • NetworkManager connection profiles;
  • process accounting log files;
  • package manager cache;
  • PAM (pluggable authentication module) data;
  • puppet utility data and log files;
  • Red Hat subscription data;
  • RHN (Red Hat Network) system id;
  • RPM databases;
  • Samba databases and log files;
  • SSH keys;
  • .ssh directories;
  • sssd database and log files;
  • temporary files in /tmp/ and /var/tmp/ directories;
  • udev manager network rules;
  • utmp file;
  • UUID of yum manager;
  • CA certificates.

If the VM is configured with LVM storage, the UUIDs of its physical disks (PV) and volume groups (VG) will be changed.

Windows

The user image is created using the sysprep utility. The utility is run with parameters:

  • /generalize — removes all unique system information, SIDs, restore points, and logs;
  • /oobe — enables OOBE mode (first system startup);
  • /shutdown — shuts down the VM after the utility completes;
  • /unattend — defines an answer file. For more information, see Answer files for OS Windows images.

Preparing Windows image from ISO image

If the administrator account name was changed while preparing the image in the OS, image creation will not be available.

To prepare an image from a VM:

  1. Create a VM without an operating system.
  2. Change the VM disk connection type to IDE: Virtual machines section → select VM → Parameters button → Virtual disk menu → Edit disk → select the ide Connection typeChange and restart button.
  3. Install Windows from an ISO image on the VM. Unmount ISO image after installation. For more information about working with ISO images, see Mounting an ISO image
  4. To prepare the VM for Virtio driver installation, create a 1 GB disk with Virtio connection type and connect it to the VM: Virtual machines section → select VM → Parameters button → Virtual diskConnect one more diskCreate and connect a disk → select Size 1 GB and virtio Connection typeConnect the disk button.
  5. Download and install the Virtio drivers.
  6. Download and install QEMU Guest Agent.
  7. Change the disk connection type to Virtio: Virtual machines section → select VM → Parameters button → Virtual disk menu → Edit disk → select the virtio Connection typeChange and restart button.
  8. Connect to the VM via VNC or SPICE and check that all hardware in Device Manager is installed correctly.

Creating images

You can create an image in the VM images or Virtual machines section.

The network settings specified in the virtual machine are not written to the VM image. Only the number of added IP addresses is taken into account. Therefore, when creating a virtual machine from the image, new free IP addresses will be assigned to it.

In the VM images section

  1. Go to TemplatesVM images → Add button.
  2. Select the Virtual machine to create the image from.
  3. Specify the image settings:

    1. By default, the New image name will be generated in the following format: <virtual machine name>_<current time in UNIX format>. To update the timestamp in the generated title, click the generate button. You can specify an arbitrary name for the image. 
    2. Select an Image owner.
    3. Select the users who can Access the newly created image: Owner only or All.
    4. If you need to remove unique information from the source VM, enable the Anonymize the image option. 

      This option is not available if:

      • QEMU Guest Agent software is not installed on the VM;
      • QEMU Guest Agent software has determined that the guest OS does not belong to the Unix or Windows family.

      The operation of the option is tested with OS from ISPsystem repository. For a list of operating systems, see Operating systems.

    5. For Windows images, upload the Windows sysprep answer file. The platform will verify that the XML markup in the file is correct. If the markup is correct, the form will display the file name with the icon . If the answer file is not formatted correctly, a warning will be displayed on the form. To delete an uploaded file, click the icon.

      If the Anonymize the image option is enabled and the answer file is not uploaded or is corrupted, the image will be created with the platform's standard answer file. For more information, see Answer files for OS Windows images.
    6. Specify an arbitrary Note.
    7. Select Storage for the image. 

      If NAS storage is connected to the cluster, only file and NAS storage will be available for selection.
  4. Click Create button.

In the Virtual machines section

  1. Go to Virtual machines →   menu → Create VM image.
  2. Specify the image settings:
     
    1. By default, the New image name will be generated in the following format: <virtual machine name>_<current time in UNIX format>. To update the timestamp in the generated title, click the generate button. You can specify an arbitrary name for the image. 
    2. Select an Image owner.
    3. Select the users who can Access the newly created image: Owner only or All.
    4. If you need to remove unique information from the source VM, enable the Anonymize the image option. 

      This option is not available if:

      • QEMU Guest Agent software is not installed on the VM;
      • QEMU Guest Agent software has determined that the guest OS does not belong to the Unix or Windows family.

      The operation of the option is tested with OS from ISPsystem repository. For a list of operating systems, see Operating systems.

    5. For Windows images, upload the Windows sysprep answer file. The platform will verify that the XML markup in the file is correct. If the markup is correct, the form will display the file name with the icon . If the answer file is not formatted correctly, a warning will be displayed on the form. To delete an uploaded file, click the icon.

      If the Anonymize the image option is enabled and the answer file is not uploaded or is corrupted, the image will be created with the platform's standard answer file. For more information, see Answer files for OS Windows images.
    6. Specify an arbitrary Note.
    7. Select Storage for the image. 

      If NAS storage is connected to the cluster, only file and NAS storage will be available for selection.
  3. Click Create button.

Managing images

To manage images, go to Templates → VM images → select an image → menu . Possible actions:

  • Create a VM from the image;
  • Edit — change image settings;
  • Copy — copy the image to another cluster node;
  • Migrate — move the image to another cluster node;
  • Delete.

You can also manage images in the card of the node on which the images are stored. To do this, go to Nodes → select a node → Disk spaceVM images tab → select an image → menu.