Sep-2024 Realistic 305-300 Accurate & Verified Answers As Experienced in the Actual Test!
Latest Lpi 305-300 Practice Test Questions, LPIC-3 Exam 305: Virtualization and Containerization Exam Dumps
NEW QUESTION # 33
Which of the following statements in aDockerfileleads to a container which outputs hello world? (Choose two.)
- A. ENTRYPOINT echo Hello World
- B. ENTRYPOINT [ "echo", "hello", "world" ]
- C. ENTRYPOINT [ "echo hello world" ]
- D. ENTRYPOINT "echo Hello World"
- E. ENTRYPOINT "echo", "Hello", "World*
Answer: B,C
Explanation:
Explanation
The ENTRYPOINT instruction in a Dockerfile specifies the default command to run when a container is started from the image. The ENTRYPOINT instruction can be written in two forms: exec form and shell form.
The exec form uses a JSON array to specify the command and its arguments, such as [ "executable",
"param1", "param2" ]. The shell form uses a single string to specify the command and its arguments, such as
"executable param1 param2". The shell form is converted to the exec form by adding /bin/sh -c to the beginning of the command. Therefore, the following statements in a Dockerfile are equivalent and will lead to a container that outputs hello world:
ENTRYPOINT [ "echo hello world" ] ENTRYPOINT [ "/bin/sh", "-c", "echo hello world" ] ENTRYPOINT
"echo hello world" ENTRYPOINT [ "echo", "hello", "world" ] ENTRYPOINT [ "/bin/sh", "-c", "echo",
"hello", "world" ] ENTRYPOINT "echo hello world"
The other statements in the question are invalid or incorrect. The statement A. ENTRYPOINT "echo Hello World" is invalid because it uses double quotes to enclose the entire command, which is not allowed in the shell form. The statement D. ENTRYPOINT echo Hello World is incorrect because it does not use quotes to enclose the command, which is required in the shell form. The statement E. ENTRYPOINT "echo", "Hello",
"World" is invalid because it uses double quotes to separate the command and its arguments, which is not allowed in the exec form. References:
* Dockerfile reference | Docker Docs
* Using the Dockerfile ENTRYPOINT and CMD Instructions - ATA Learning
* Difference Between run, cmd and entrypoint in a Dockerfile
NEW QUESTION # 34
Which of the following resources can be limited by libvirt for a KVM domain? (Choose two.)
- A. Size of available memory
- B. File systems allowed in the domain
- C. Number of running processes
- D. Amount of CPU lime
- E. Number of available files
Answer: A,D
Explanation:
Explanation
Libvirt is a toolkit that provides a common API for managing different virtualization technologies, such as KVM, Xen, LXC, and others. Libvirt allows users to configure and control various aspects of a virtual machine (also called a domain), such as its CPU, memory, disk, network, and other resources. Among the resources that can be limited by libvirt for a KVM domain are:
* Amount of CPU time: Libvirt allows users to specify the number of virtual CPUs (vCPUs) that a domain can use, as well as the CPU mode, model, topology, and tuning parameters. Users can also set the CPU shares, quota, and period to control the relative or absolute amount of CPU time that a domain can consume. Additionally, users can pin vCPUs to physical CPUs or NUMA nodes to improve performance and isolation. These settings can be configured in the domain XML file under the <cpu> and <cputune> elements12.
* Size of available memory: Libvirt allows users to specify the amount of memory that a domain can use, as well as the memory backing, tuning, and NUMA node parameters. Users can also set the memory hard and soft limits, swap hard limit, and minimum guarantee to control the memory allocation and reclaim policies for a domain. These settings can be configured in the domain XML file under the <memory>, <memoryBacking>, and <memtune> elements13.
The other resources listed in the question are not directly limited by libvirt for a KVM domain. File systems allowed in the domain are determined by the disk and filesystem devices that are attached to the domain, which can be configured in the domain XML file under the <disk> and <filesystem> elements14. Number of running processes and number of available files are determined by the operating system and the file system of the domain, which are not controlled by libvirt.
References:
* libvirt: Domain XML format
* CPU Allocation
* Memory Allocation
* Hard drives, floppy disks, CDROMs
NEW QUESTION # 35
Which of the following statements is true regarding the following output ofxl list:
- A. Ubuntu is idle or waiting for I/O.
- B. CentOS is the domain which has consumed the most CPU time.
- C. The domain with ID 2 uses Para virtualization.
- D. Both Debian and Ubuntu require xl commands to start running.
- E. It is necessary to use the xl command to change Ubuntu's state to running.
Answer: A
Explanation:
Explanation
The output of xl list shows the state of the domains. The domain with ID 6, Ubuntu, has a state of "b-". This means that the domain is blocked, which means it is idle or waiting for I/O.
https://xenbits.xen.org/docs/unstable/man/xl.1.html
NEW QUESTION # 36
What kind of virtualization is implemented by LXC?
- A. Hardware containers
- B. Paravirtualization
- C. Application containers
- D. System containers
- E. CPU emulation
Answer: D
NEW QUESTION # 37
Which of the following resources can be limited by libvirt for a KVM domain? (Choose two.)
- A. Size of available memory
- B. File systems allowed in the domain
- C. Number of running processes
- D. Amount of CPU lime
- E. Number of available files
Answer: A,D
NEW QUESTION # 38
Which file format is used by libvirt to store configuration data?
- A. Text files containing key/value pairs
- B. SQLite databases
- C. XML files
- D. INI-style text files
- E. Java-like properties files
Answer: C
Explanation:
Explanation
Libvirt uses XML files to store configuration data for objects in the libvirt API, such as domains, networks, storage, etc. This allows for ease of extension in future releases and validation of documents prior to usage.
Libvirt does not use any of the other file formats listed in the question. References:
* libvirt: XML Format
* LPIC-3 Virtualization and Containerization: Topic 305.1: Virtualization Concepts and Theory
NEW QUESTION # 39
What is the purpose of a .dockerignore file?
- A. It must be placed in the top level directory of volumes that Docker should never attach automatically to a container
- B. It exists in the root file system of containers that should ignore volumes and ports provided by Docker.
- C. It specifies files that Docker does not submit to the Docker daemon when building a Docker image
- D. It lists files existing in a Docker image which should be excluded when building a derivative image.
- E. It specifies which parts of a Dockerfile should be ignored when building a Docker image.
Answer: C
NEW QUESTION # 40
Which of the following network interface types are valid in an LXD container configuration? (Choose three.)
- A. ipsec
- B. bridged
- C. wifi
- D. macvlan
- E. physical
Answer: B,D,E
Explanation:
Explanation
LXD supports the following network interface types in an LXD container configuration1:
* macvlan: Creates a virtual interface on the host with a unique MAC address and attaches it to an existing physical interface. This allows the container to have direct access to the physical network, but prevents communication with the host and other containers on the same host2.
* bridged: Connects the container to an existing bridge interface on the host. This allows the container to communicate with the host and other containers on the same bridge, as well as the external network if the bridge is connected to a physical interface3.
* physical: Passes an existing physical interface on the host to the container. This allows the container to have exclusive access to the physical network, but removes the interface from the host4.
The other network interface types, ipsec and wifi, are not valid in an LXD container configuration. Ipsec is a protocol for secure communication over IP networks, not a network interface type. Wifi is a wireless technology for connecting devices to a network, not a network interface type. References:
* About networking - Canonical LXD documentation
* Macvlan network - Canonical LXD documentation
* Bridge network - Canonical LXD documentation
* Physical network - Canonical LXD documentation
NEW QUESTION # 41
Which of the following types of guest systems does Xen support? (Choose two.)
- A. Fully virtualized guests
- B. Foreign architecture guests (FA)
- C. Container virtualized guests
- D. Paravirtualized quests (PVI
- E. Emulated guests
Answer: A,D
Explanation:
Explanation
Xen supports two types of guest systems: paravirtualized guests (PV) and fully virtualized guests (HVM).
* Paravirtualized guests (PV) are guests that have been modified to run on the Xen hypervisor. They use a special kernel that communicates with the hypervisor through hypercalls, and use paravirtualized drivers
* for I/O devices. PV guests can run faster and more efficiently than HVM guests, but they require the guest operating system to be ported to Xen and to support the Xen ABI12.
* Fully virtualized guests (HVM) are guests that run unmodified operating systems on the Xen hypervisor.
They use hardware virtualization extensions, such as Intel VT-x or AMD-V, to create a virtual platform for the guest. HVM guests can run any operating system that supports the hardware architecture, but they incur more overhead and performance penalties than PV guests. HVM guests can also use paravirtualized drivers for I/O devices to improve their performance12.
The other options are not correct. Xen does not support foreign architecture guests (FA), emulated guests, or container virtualized guests.
* Foreign architecture guests (FA) are guests that run on a different hardware architecture than the host.
For example, running an ARM guest on an x86 host. Xen does not support this type of virtualization, as it would require emulation or binary translation, which are very complex and slow techniques3.
* Emulated guests are guests that run on a software emulator that mimics the hardware of the host or another platform. For example, running a Windows guest on a QEMU emulator. Xen does not support this type of virtualization, as it relies on the emulator to provide the virtual platform, not the hypervisor. Xen can use QEMU to emulate some devices for HVM guests, but not the entire platform14.
* Container virtualized guests are guests that run on a shared kernel with the host and other guests, using namespaces and cgroups to isolate them. For example, running a Linux guest on a Docker container. Xen does not support this type of virtualization, as it requires the guest operating system to be compatible with the host kernel, and does not provide the same level of isolation and security as hypervisor-based virtualization56.
References:
* Xen Project Software Overview - Xen
* Xen ARM with Virtualization Extensions - Xen
* Xen Project Beginners Guide - Xen
* QEMU - Xen
* Docker overview | Docker Documentation
* What is a Container? | App Containerization | VMware
NEW QUESTION # 42
Which of the following types of guest systems does Xen support? (Choose two.)
- A. Fully virtualized guests
- B. Foreign architecture guests (FA)
- C. Container virtualized guests
- D. Paravirtualized quests (PVI
- E. Emulated guests
Answer: A,D
NEW QUESTION # 43
Which of the following commands executes a command in a running LXC container?
- A. lxc-eval
- B. lxc-run
- C. lxc-enter
- D. lxc-batch
- E. lxc-accach
Answer: E
NEW QUESTION # 44
What is the purpose of capabilities in the context of container virtualization?
- A. Map potentially dangerous system calls to an emulation layer provided by the container virtualization.
- B. Allow regular users to start containers with elevated permissions.
- C. Restrict the disk space a container can consume.
- D. Enable memory deduplication to cache files which exist in multiple containers.
- E. Prevent processes from performing actions which might infringe the container.
Answer: E
NEW QUESTION # 45
A clone of a previously used virtual machine should be created. All VM specific information, such as user accounts, shell histories and SSH host keys should be removed from the cloned disk image. Which of the following tools can perform these tasks?
- A. virt-sparsi
- B. vire-wipe
- C. virc-reset
- D. virt-svspre
- E. virt-rescue
- F. sysprep
Answer: D
NEW QUESTION # 46
If aDockerfilecontains the following lines:
WORKDIR /
RUN cd /tmp
RUN echo test > test
where is the filetestlocated?
- A. /test within the container image.
- B. /root/tesc within the container image.
- C. /tmp/test on the system running docker build.
- D. /ting/test within the container image.
- E. test in the directory holding the Dockerf ile.
Answer: A
Explanation:
Explanation
The WORKDIR instruction sets the working directory for any subsequent RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile1. The RUN instruction executes commands in a new layer on top of the current image and commits the results2. The RUN cd command does not change the working directory for the next RUN instruction, because each RUN command runs in a new shell and a new environment3. Therefore, the file test is created in the root directory (/) of the container image, not in the /tmp directory. References:
* Dockerfile reference: WORKDIR
* Dockerfile reference: RUN
* difference between RUN cd and WORKDIR in Dockerfile
NEW QUESTION # 47
FILL BLANK
Which subcommand ofvirshopens the XML configuration of a virtual network in an editor in order to make changes to that configuration? (Specify ONLY the subcommand without any parameters.)
Answer:
Explanation:
net-edit
NEW QUESTION # 48
Which of the following devices exist by default in an LXC container? (Choose three.)
- A. /dev/root
- B. /dev/kmem
- C. /dev/console
- D. /dev/log
- E. /dev/urandom
Answer: C,D,E
Explanation:
Explanation
LXC (Linux Containers) is a lightweight virtualization technology that allows multiple isolated Linux systems (containers) to run on the same host. LXC uses Linux kernel features such as namespaces, cgroups, and AppArmor to create and manage containers. Each container has its own file system, network interfaces, process tree, and resource limits. However, containers share the same kernel and hardware with the host, which makes them more efficient and faster than full virtualization.
By default, an LXC container has a minimal set of devices that are needed for its operation. These devices are created by the LXC library when the container is started, and are removed when the container is stopped. The default devices are:
* /dev/log: This is a Unix domain socket that connects to the syslog daemon on the host. It allows the container to send log messages to the host's system log1.
* /dev/console: This is a character device that provides access to the container's console. It is usually connected to the host's terminal or a file. It allows the container to interact with the user or the host's init system12.
* /dev/urandom: This is a character device that provides an unlimited source of pseudo-random numbers. It is used by various applications and libraries that need randomness, such as cryptography, UUID generation, and hashing13.
The other devices listed in the question do not exist by default in an LXC container. They are either not needed, not allowed, or not supported by the container's namespace or cgroup configuration. These devices are:
* /dev/kmem: This is a character device that provides access to the kernel's virtual memory. It is not needed by the container, as it can access its own memory through the /proc filesystem. It isalso not allowed by the container, as it would expose the host's kernel memory and compromise its security4.
* /dev/root: This is a symbolic link that points to the root device of the system. It is not supported by the container, as it does not have a separate root device from the host. The container's root file system is mounted from a directory, an image file, or a loop device on the host5.
References:
* Linux Containers - LXC - Manpages - lxc.container.conf.5
* Linux Containers - LXC - Getting started
* Random number generation - Wikipedia
* /dev/kmem - Wikipedia
* Linux Containers - LXC - Manpages - lxc.container.conf.5
NEW QUESTION # 49
Which of the following tasks are part of a hypervisor's responsibility? (Choose two.)
- A. Map the resources of virtual machines to the resources of the host system.
- B. Manage authentication to network services running inside a virtual machine.
- C. Create filesystems during the installation of new virtual machine quest operating systems.
- D. Provide host-wide unique PIDs to the processes running inside the virtual machines in order to ease inter-process communication between virtual machines.
- E. Isolate the virtual machines and prevent unauthorized access to resources of other virtual machines.
Answer: A,E
NEW QUESTION # 50
Which of the following commands deletes all volumes which are not associated with a container?
- A. docker volume vacuum
- B. docker volume garbage-collect
- C. docker volume cleanup
- D. docker volume prune
- E. docker volume orphan -d
Answer: D
NEW QUESTION # 51
What does IaaS stand for?
- A. Instances as a Service
- B. Intelligence as a Service
- C. Integration as a Service
- D. Infrastructure as a Service
- E. Information as a Service
Answer: D
NEW QUESTION # 52
What is the purpose of the commandvagrantinit?
- A. It executes a provisioning tool in a running box.
- B. It creates a Vagrant configuration file.
- C. It installs Vagrant on a Linux host.
- D. It downloads a Vagrant box.
- E. It starts a Vagrant box.
Answer: B
NEW QUESTION # 53
Which CPU flag indicates the hardware virtualization capability on an AMD CPU?
- A. HVM
- B. SVM
- C. PVM
- D. VMX
- E. VIRT
Answer: B
NEW QUESTION # 54
FILL BLANK
What LXC command starts a new process within a running LXC container? (Specify ONLY the command without any path or parameters.)
Answer:
Explanation:
lxc-attach
Explanation
The lxc-attach command allows the user to start a new process within a running LXC container12. It takes the name of the container as an argument and optionally a command to execute inside the container. If no command is specified, it creates a new shell inside the container1. For example, to list all the files in the home directory of a container named myContainer, one can use:
lxc-attach -n myContainer - ls -lh /home
References:
* 1: Executing a command inside a running LXC - Unix & Linux Stack Exchange
NEW QUESTION # 55
Ifdocker stackis to be used to run a Docker Compose file on a Docker Swarm, how are the images referenced in the Docker Compose configuration made available on the Swarm nodes?
- A. docker stack builds the images locally and copies them to only those Swarm nodes which run the service.
- B. docker stack transfers the image from its local Docker cache to each Swarm node.
- C. docker stack triggers the build process for the images on all nodes of the Swarm.
- D. docker stack instructs the Swarm nodes to pull the images from a registry, although it does not upload the images to the registry.
- E. docker stack passes the images to the Swarm master which distributes the images to all other Swarm nodes.
Answer: D
Explanation:
Explanation
Docker stack is a command that allows users to deploy and manage a stack of services on a Docker Swarm cluster. A stack is a group of interrelated services that share dependencies and can be orchestrated and scaled together. A stack is typically defined by a Compose file, which is a YAML file that describes the services, networks, volumes, and other resources of the stack. To use docker stack to run a Compose file on a Swarm, the user must first create and initialize a Swarm cluster, which is a group of machines (nodes) that are running the Docker Engine and are joined into a single entity. The Swarm cluster has one or more managers, which are responsible for maintaining the cluster state and orchestrating the services, and one or more workers, which are the nodes that run the services.
When the user runs docker stack deploy with a Compose file, the command parses the file and creates the services as specified. However, docker stack does not build or upload the images referenced in the Compose file to any registry. Instead, it instructs the Swarm nodes to pull the images from a registry, which can be the public Docker Hub or a private registry. The user must ensure that the images are available in the registry before deploying the stack, otherwise the deployment will fail. The user can use docker build and docker push commands to create and upload the images to the registry, or use an automated build service such as Docker Hub or GitHub Actions. The user must also make sure that the image names and tags in the Compose file match the ones in the registry, and that the Swarm nodes have access to the registry if it is private. By pulling the images from a registry, docker stack ensures that the Swarm nodes have the same and latest version of the images, and that the images are distributed across the cluster in an efficient way.
The other options are not correct. Docker stack does not build the images locally or on the Swarm nodes, nor does it copy or transfer the images to the Swarm nodes. Dockerstack also does not pass the images to the Swarm master, as this would create a bottleneck and a single point of failure. Docker stack relies on the registry as the source of truth for the images, and delegates the image pulling to the Swarm nodes. References:
* Deploy a stack to a swarm | Docker Docs1
* docker stack deploy | Docker Docs2
* docker build | Docker Docs3
* docker push | Docker Docs4
NEW QUESTION # 56
......
Free 305-300 Exam Files Downloaded Instantly 100% Dumps & Practice Exam: https://testking.exams-boost.com/305-300-valid-materials.html