LCA Virtualization & Container Management 5 — Questions and Answers
Question 1: Which command migrates a running KVM virtual machine to another host without downtime?
- virsh move
- virsh migrate --live (Correct answer)
- virt-clone --live
- qemu-migrate --hot
Correct answer: virsh migrate --live
'virsh migrate --live' performs live migration, transferring VM memory pages to the target host while the guest continues running.
Question 2: What is the difference between a Docker image and a Docker container?
- Images are running instances; containers are static templates
- Images are read-only templates; containers are writable running instances (Correct answer)
- Images store logs; containers store configuration
- Images run on the host; containers run in the cloud
Correct answer: Images are read-only templates; containers are writable running instances
A Docker image is an immutable layered template, while a container is a live, writable instance created from that image.
Question 3: What does 'virt-clone' do in a KVM environment?
- Migrates a VM to another hypervisor
- Creates a copy of an existing virtual machine definition and disk (Correct answer)
- Takes a snapshot of a running VM
- Exports a VM to OVF format
Correct answer: Creates a copy of an existing virtual machine definition and disk
virt-clone duplicates an existing VM's XML configuration and disk image to create a new independent virtual machine.
Question 4: Which Docker networking mode shares the host's network stack directly with the container?
- bridge
- host (Correct answer)
- overlay
- macvlan
Correct answer: host
In 'host' network mode, the container uses the host's network interfaces directly with no isolation or NAT.
Question 5: What does the OCI (Open Container Initiative) standardize?
- Container orchestration APIs across cloud providers
- Container image format and runtime specifications (Correct answer)
- Kubernetes networking plugin interfaces
- Docker registry authentication protocols
Correct answer: Container image format and runtime specifications
OCI defines open industry standards for container image format (image-spec) and container runtime behavior (runtime-spec).
Question 6: In a KVM environment, what is SPICE used for?
- Network packet inspection between VMs
- Remote display protocol for virtual machine graphical consoles (Correct answer)
- Storage encryption for VM disk images
- Live memory ballooning between guests
Correct answer: Remote display protocol for virtual machine graphical consoles
SPICE (Simple Protocol for Independent Computing Environments) provides high-performance remote display access to KVM VM graphical consoles.
Question 7: Which flag in 'docker run' automatically removes the container when it exits?
- --delete
- --rm (Correct answer)
- --cleanup
- --once
Correct answer: --rm
The '--rm' flag tells Docker to automatically remove the container's writable layer and metadata when the container stops.
Which command migrates a running KVM virtual machine to another host without downtime?