Courseiva

305-300 · domain

VM Deployment And Provisioning

This domain covers automated VM image creation and guest provisioning on the LPIC-3 305 exam. It tests Packer builders and post-processors for OpenStack, Vagrant box handling and Vagrantfile provisioning options, and cloud-init configuration syntax. Questions are scenario-based, asking you to identify the correct builder, post-processor, Vagrantfile method, or cloud-init directive for a given provisioning task.

36 questions6 easy17 medium13 hard

Focused practice

Practice VM Deployment And Provisioning questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about VM Deployment And Provisioning

You must be able to write and interpret Packer templates, Vagrantfiles, and cloud-init configs for automated VM deployment. The single most important thing is matching each tool's component to its role: builder versus post-processor, provisioner versus provider, and correct cloud-init file headers.

Packer post-processor types, including docker-import and vagrant, and uploading images to OpenStack Glance

Vagrantfile provisioning methods such as shell, file, and ansible, plus passing environment variables into guests

Vagrant box resolution behavior, including downloading boxes from the Vagrant Cloud registry when absent locally

cloud-init configuration file headers and module directives, including the #cloud-config first-line requirement

Watch out for

Common VM Deployment And Provisioning exam traps

  • ▸Confusing Packer builders with post-processors: the openstack builder creates the image, while a separate post-processor uploads it to Glance.
  • ▸Assuming Vagrant fails when a box is missing locally; by default it attempts to download the box from the configured registry.
  • ▸Forgetting that cloud-init requires the exact #cloud-config header on the first line, otherwise the file is ignored or misparsed.

Question index

All VM Deployment And Provisioning questions (36)

Click any question to see the full explanation, or start a practice session above.

1

A Packer build targeting the qemu builder completes, but the resulting image boots to a login prompt and never runs your provisioning scripts. You configured an ssh communicator with a username and password. Which condition most likely prevents Packer from connecting to the guest during the build?

Hard
2

You are using Vagrant to manage a development environment. You need to run a shell script that installs dependencies after the VM boots for the first time. Which provisioner type should you use in your Vagrantfile?

Easy
3

When provisioning with Vagrant, which command is best used to apply changes to a configuration (like adding a new shell script) without destroying the existing virtual machine?

Medium
4

In a Vagrant environment, where should sensitive data like API keys be stored to avoid committing them to version control?

Medium
5

You are provisioning a KVM guest with virt-install. The guest must use a pre-existing disk image located at /var/lib/libvirt/images/web.img and must not have the image created or modified by virt-install. Which option should you include in the virt-install command?

Medium
6

Which THREE settings are commonly configured in the 'provider' block of a Vagrantfile for virtualbox?

Medium
7

When using Vagrant to manage a libvirt-based provider, which command verifies that the virtual machine is currently running and identifies the provider in use?

Easy
8

You need to ensure that a specific package is installed during the first boot of a cloud instance. Which cloud-init key should be added to the configuration?

Medium
9

Which command is used to display the configuration of a Packer build in a readable format?

Easy
10

When defining a Vagrant network configuration for a libvirt provider, which mode allows the VM to receive an IP address directly from the physical network's DHCP server?

Medium
11

Which file in a Vagrant project directory is processed by default to define the virtual environment configuration?

Easy
12

Which THREE configuration items can be managed via cloud-init 'write_files' module?

Hard
13

In a Vagrantfile, which method is used to pass environment variables into the guest virtual machine during the provisioning phase?

Hard
14

You are using cloud-init to configure a VM that must run a script only on the very first boot, and the script must not run again on subsequent reboots. The script is provided as a MIME part in a multipart user-data file. Which cloud-init module should be used to ensure this behavior?

Hard
15

What is the default behavior of Vagrant when a box is not found locally on the host machine?

Easy
16

Which tool is commonly used alongside Packer to validate the configuration file for syntax errors before attempting a build?

Medium
17

In cloud-init, which syntax is required at the very beginning of the configuration file to ensure it is recognized as a cloud-config script?

Hard
18

You are building a Vagrant environment for a development team. The Vagrantfile must provision three identical web servers and one load balancer, all using the same base box but with different hostnames and static IP addresses. Which Vagrantfile construct should you use to define these machines and their individual settings?

Medium
19

When using Vagrant with multiple machines in a single Vagrantfile, how do you define individual configurations?

Medium
20

Which cloud-init module is responsible for setting the hostname of the instance during the initial boot process?

Medium
21

You maintain a Vagrant environment where a single Vagrantfile defines three web servers and one database server. You need each web server to use a different forwarded SSH port on the host because port 2222 is already taken by another project. Which approach correctly assigns unique host ports per machine?

Medium
22

A Packer template targets the qemu builder to produce a KVM-compatible image. The build completes without error, but when the resulting qcow2 file is booted with `qemu-system-x86_64 -drive file=image.qcow2,if=virtio`, the guest kernel panics with "VFS: Unable to mount root fs" because it cannot see any block device. The template defines only `iso_url`, `iso_checksum`, `ssh_username`, and `ssh_password`. Which change to the template is MOST likely to resolve this?

Hard
23

Which TWO components are defined in a Packer 'build' block?

Hard
24

When using Packer with the QEMU builder, what does the 'format' option in the 'qemu' builder define?

Hard
25

Which TWO pieces of information does Packer require to build an image for an existing cloud environment?

Hard
26

You are configuring cloud-init to inject an SSH key into a new VM. Which directive in the configuration metadata ensures the key is added to the correct user's authorized_keys file?

Hard
27

You are using Packer to build a KVM-compatible QEMU image for an on-premises OpenStack cloud. The build completes successfully, but the resulting image fails to boot because the virtual disk is not recognized. You verify that the QEMU builder is configured with accelerator 'kvm' and the correct machine type. Which QEMU builder option should you review to ensure the disk image is created in a format that OpenStack can use?

Hard
28

In a Packer build process for OpenStack, which 'post-processor' type is typically used to upload the resulting image to the Glance image service?

Medium
29

A cloud-init configuration file is failing to apply the 'write_files' module. Which log file on the target instance should you examine to diagnose the parsing error?

Medium
30

You are creating a Vagrant environment for a development team. The team needs a single VM that uses the 'ubuntu/jammy64' box and forwards host port 8080 to guest port 80. Which Vagrantfile configuration block correctly defines this?

Easy
31

What is the primary function of the cloud-init 'runcmd' module?

Medium
32

Which THREE of the following are common cloud-init modules?

Medium
33

Which THREE directives are valid under the cloud-init 'users' configuration section?

Medium
34

Which TWO methods can be used to pass configuration data to cloud-init during instance creation?

Hard
35

You are using Packer to build an image for a private cloud. The build uses the 'qemu' builder and a 'shell' provisioner. The provisioner script runs but fails to install a package because the package repository is unreachable. You suspect the VM has no network connectivity during provisioning. Which Packer feature should you verify to ensure the VM has network access?

Hard
36

Which Packer builder is most appropriate for creating an image specifically for Amazon Web Services (AWS)?

Medium

Frequently asked questions

What does the VM Deployment And Provisioning domain cover on the 305-300 exam?
You must be able to write and interpret Packer templates, Vagrantfiles, and cloud-init configs for automated VM deployment. The single most important thing is matching each tool's component to its role: builder versus post-processor, provisioner versus provider, and correct cloud-init file headers.
How many questions are in this domain?
This page lists all 36 VM Deployment And Provisioning questions in the 305-300 question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only VM Deployment And Provisioning questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
LPIC-3 Exam 305: Virtualization and Containerization (305-300) (305-300) VM Deployment And Provisioning Practice Questions