Cloning, backing up, restoring

What sets a clone, a template, a snapshot and a backup apart for a virtual machine, then, for containers, what is rebuilt and what is backed up, down to the verified restore.

  • 29 cards
  • 5 topics
  • Free

The outline, topic by topic

Each topic is weighted the way the exam weighs it.

  1. Concepts
  2. Questions
  3. Sort and link
  4. Scenarios
  5. Understand

A few cards from the deck

  • VM clone: what is it?

    Show the answer

    A copy of a virtual machine that becomes an independent machine, with its own disks and its own identity (name, MAC address).

    A full clone no longer depends on the source. A linked clone shares its base disks with it: faster and lighter, but unusable if the source disappears.

  • Which command archives the pgdata volume in the host's current folder?

    • docker run --rm -v pgdata:/data -v "$(pwd)":/backup alpine tar czf /backup/pgdata.tgz /data
    • docker run --rm -v pgdata:/backup -v "$(pwd)":/data alpine tar czf /backup/pgdata.tgz /data
    • docker run --rm -v pgdata:/data alpine tar czf pgdata.tgz /data
    • docker export pgdata | gzip > pgdata.tgz
    Show the answer

    docker run --rm -v pgdata:/data -v "$(pwd)":/backup alpine tar czf /backup/pgdata.tgz /data

    A throwaway container mounts the volume (at /data) and the host folder (at /backup), then tar writes the archive into the latter. The second mixes up the mounts, the third leaves the archive inside the container, which vanishes with --rm, and docker export does not take a volume.

  • A … is a frozen reference virtual machine from which … are made to deploy several identical machines.

    Show the answer

    A template is a frozen reference virtual machine from which clones are made to deploy several identical machines.

    The system is prepared once (updates, tools), then cloned: each clone gets its own identity (hostname, MAC address) so it does not clash with the others.

  • VM snapshot: what is it?

    Show the answer

    The state of a virtual machine frozen at one moment, to which you can return; later writes are stored separately, in a differencing disk.

    It lives on the same storage as the machine: if the storage is lost, so is the snapshot. It is a quick way back before a risky operation, not a backup.

  • The archive of PostgreSQL's data folder, copied while the database was writing, will not start after restore. Probable cause?

    • The archive is too big to be extracted into a volume
    • The copy is inconsistent: its files date from different moments
    • The PostgreSQL version in the image changed the tar format
    • PostgreSQL refuses data copied from another container
    Show the answer

    The copy is inconsistent: its files date from different moments

    At startup the database reports, for example, "PANIC: could not locate a valid checkpoint record": the log and the data files no longer match. The fix is a consistent copy: an export with pg_dump, a consistent disk snapshot, or copying after the database has been stopped.