305-300 Practice Questions
Prepare for 305-300 with more than an answer.
- Exam fee
- $340 USD
- Level
- Expert
- Valid for
- 5 years
Domains covered on the exam 3
- Full Virtualization41.67%
- Container Virtualization41.67%
- VM Deployment and Provisioning13.33%
- 1
A Docker container running a web application is unexpectedly slow. You suspect the container is being throttled on disk I/O. Which command would you use to view real-time block I/O statistics for all running containers?
Show answer details
Correct answer: D
The
docker statscommand provides a live stream of resource usage statistics for running containers. This includes CPU usage, memory usage, network I/O, and crucially for this scenario, block I/O (disk reads and writes). This allows an administrator to quickly identify if a container is performing an excessive amount of disk activity.docker topshows processes inside a container,docker eventsshows daemon events, anddocker system dfshows overall disk usage by Docker objects. - 2
True or False: In a Xen environment, a Hardware-assisted Virtual Machine (HVM) guest requires a specially modified kernel to run, while a Para-Virtualized (PV) guest can run an unmodified operating system.
Show answer details
Correct answer: B
False. The statement reverses the concepts. A Para-Virtualized (PV) guest has a modified kernel that is aware it is being virtualized, allowing it to communicate directly with the hypervisor for better performance in some cases. A Hardware-assisted Virtual Machine (HVM) guest uses CPU virtualization extensions (like Intel VT-x or AMD-V) to run a completely unmodified operating system, as the hardware provides the necessary abstraction.
- 3
An administrator is launching a QEMU/KVM virtual machine directly from the command line. They want to enable the QEMU Guest Agent for this VM, which is connected via a virtio-serial port. Which command-line argument should be added to the
qemu-system-x86_64command?Show answer details
Correct answer: A
To enable the QEMU Guest Agent, you need a three-part configuration. First,
-device virtio-serial-pciadds the virtio serial device to the VM. Second,-chardev socket,...creates a character device on the host, in this case a Unix socket. Third,-device virtserialport,...connects the virtio serial device inside the VM to the character device on the host. This combination establishes the communication channel for the guest agent. The other options are incomplete or use incorrect device names. - 4
A developer needs to create a Docker container for a Python application that will run in a production environment with strict memory constraints. Which of the following should be configured to prevent the container from consuming excessive system resources? (Select TWO)
Show answer details
Correct answer: A, C
Docker uses kernel cgroups to enforce resource limits. The
--memory(or-m) flag sets a hard limit on the amount of RAM the container can use. To prevent the container from using swap space when it hits its memory limit (which can lead to performance degradation), you should set--memory-swapto the same value as--memory. This effectively disables swapping for the container.ulimitsets limits per-process, not for the entire container cgroup, and--shm-sizerelates to shared memory, not main RAM usage. - 5
A cloud engineer is deploying a new VM instance using an image that supports
cloud-init. They need to configure a new user, install specific packages, and write a configuration file on the first boot. Which of the followingcloud-configuser-data snippets correctly demonstrates how to create a user namedappadmin, installnginxandhtop, and write a simpleindex.htmlfile?graph TD A[Start Instance] --> B{Read User-Data} B --> C[Create User 'appadmin'] B --> D[Install Packages] B --> E[Write Files] C --> F[Instance Ready] D --> F E --> FShow answer details
Correct answer: A
The correct
cloud-configsyntax, which starts with the#cloud-configshebang, uses declarative, top-level keys likeusers,packages, andwrite_files. This option correctly uses a list for theusersmodule to define the new user and their sudo privileges, a list for thepackagesmodule to specify packages for installation, and thewrite_filesmodule to create a file with specified content. - 6
A DevOps team is experiencing inconsistent application behavior in KVM guests running on a NUMA-based host. Performance analysis indicates that VMs are frequently accessing memory from remote NUMA nodes, causing high latency. Which
virshsubcommand should be used to inspect the current NUMA configuration and CPU pinning for a running domain namedapp-vm1?Show answer details
Correct answer: C
The
virsh numatunecommand is specifically designed to display and modify NUMA parameters for a running virtual machine. This command provides details on memory node binding and vCPU to physical CPU pinning, which is essential for diagnosing and resolving NUMA-related performance issues.vcpuinfoshows vCPU state but not pinning,nodeinfoshows host NUMA details but not the VM's configuration, andmemtunecontrols overall memory limits, not NUMA placement. - 7
An administrator is building a minimal, secure Docker image for a Go application. To reduce the attack surface and image size, they are using a multi-stage build. Which of the following are key benefits of this approach? (Select TWO)
Show answer details
Correct answer: A, D
Multi-stage builds allow you to use one stage with a full SDK to build the application (e.g.,
golang:1.19) and a subsequent stage to copy only the compiled binary into a minimal base image (e.g.,scratchoralpine). This ensures that build-time dependencies, compilers, and source code are not present in the final image, dramatically reducing its size and attack surface. It does not automatically handle image signing or affect the build cache in the described manner. - 8
A system administrator needs to convert a VMware VMDK disk image (
source.vmdk) to a QCOW2 format for use with KVM, while also enabling compression and preallocating all metadata to improve performance. Whichqemu-img convertcommand achieves this?Show answer details
Correct answer: B
The correct command is
qemu-img convert -f vmdk -O qcow2 -c -o preallocation=metadata source.vmdk target.qcow2. The-fflag specifies the source format,-Ospecifies the output format. The-cflag is the shorthand for enabling qcow2 compression. The-oflag is used for format-specific options, andpreallocation=metadatatells qemu-img to create a non-sparse image where only the metadata is preallocated, which can improve performance by avoiding metadata fragmentation. - 9
You are tasked with setting up a highly available LXD cluster for running critical system containers. During the initialization of the second cluster node, you are prompted for the address of an existing cluster member. After providing the address and the trust password, the join process fails with a network timeout. The nodes are on the same subnet, and basic
pingtests between them are successful. What is the most likely cause of this failure?Show answer details
Correct answer: B
LXD clustering relies on communication over TCP port 8443 for its API and internal raft consensus protocol. While ICMP (ping) may be allowed, a common security practice is to block most incoming ports by default. A network timeout during the join process, despite successful ping tests, strongly indicates that a firewall is blocking the specific port LXD requires for cluster communication. Storage pool names being different or NTP issues would typically result in different error messages after the initial connection is established.
- 10
True or False: When using the
libvirtprovider in Vagrant, theVagrantfilemust explicitly define a private network for the VM to be accessible from the host, as no default NAT network is created automatically.Show answer details
Correct answer: B
False. By default, the
vagrant-libvirtprovider will attempt to connect the VM to libvirt's 'default' virtual network, which is typically a NAT-based network. This allows the VM to access the external network and provides a DHCP-assigned IP address. While defining a private network (config.vm.network "private_network") is a common practice for stable host-to-guest communication, it is not strictly required for the VM to get network connectivity upon creation.
