Free EX316 Questions for RedHat Red Hat Certified Specialist in OpenShift Virtualization EX316 Exam as PDF & Practice Test Engine
How do you define a secondary physical NIC on a node using NMState?
Correct Answer:
See the Explanation.
Explanation:
1. Create a NodeNetworkConfigurationPolicy YAML:
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: enable-second-nic
spec:
nodeSelector:
kubernetes.io/hostname: worker-0
desiredState:
interfaces:
- name: ens5
type: ethernet
state: up
2. Apply with oc apply -f
3. Check status: oc get nncp enable-second-nic -o yaml
4. Ensure Available: True
5. Confirm with oc debug node/worker-0 ip a
Explanation:
1. Create a NodeNetworkConfigurationPolicy YAML:
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: enable-second-nic
spec:
nodeSelector:
kubernetes.io/hostname: worker-0
desiredState:
interfaces:
- name: ens5
type: ethernet
state: up
2. Apply with oc apply -f
3. Check status: oc get nncp enable-second-nic -o yaml
4. Ensure Available: True
5. Confirm with oc debug node/worker-0 ip a
How do you create an S3-compatible backup storage location for OADP?
Correct Answer:
See the Explanation.
Explanation:
1. Create a secret with access credentials:
oc create secret generic cloud-credentials \
--from-literal=cloud=aws \
--from-literal=aws_access_key_id=<ID> \
--from-literal=aws_secret_access_key=<KEY> \
-n oadp-operator
2. Apply BackupStorageLocation:
apiVersion: velero.io/v1
kind: BackupStorageLocation
metadata:
name: default
namespace: oadp-operator
spec:
provider: aws
objectStorage:
bucket: oadp-backup
prefix: vm-backups
config:
region: us-east-1
s3Url: https://<s3-provider-url>
insecureSkipTLSVerify: "true"
Explanation:
1. Create a secret with access credentials:
oc create secret generic cloud-credentials \
--from-literal=cloud=aws \
--from-literal=aws_access_key_id=<ID> \
--from-literal=aws_secret_access_key=<KEY> \
-n oadp-operator
2. Apply BackupStorageLocation:
apiVersion: velero.io/v1
kind: BackupStorageLocation
metadata:
name: default
namespace: oadp-operator
spec:
provider: aws
objectStorage:
bucket: oadp-backup
prefix: vm-backups
config:
region: us-east-1
s3Url: https://<s3-provider-url>
insecureSkipTLSVerify: "true"
How do you use a CSI volume as a block disk in a VM?
Correct Answer:
See the Explanation.
Explanation:
1. Provision a PVC with volumeMode: Block
2. Attach to VM under volumeMode:
block: volumeMode: Block
3. Use lun style device definition.
4. Start VM and format/mount inside.
5. Check with lsblk for raw block device.
Explanation:
1. Provision a PVC with volumeMode: Block
2. Attach to VM under volumeMode:
block: volumeMode: Block
3. Use lun style device definition.
4. Start VM and format/mount inside.
5. Check with lsblk for raw block device.
How do you create a virtual machine using the OpenShift Web Console?
Correct Answer:
See the Explanation.
Explanation:
1. Go to Administrator view Virtualization VirtualMachines.
2. Click Create > From Template or Create VirtualMachine.
3. Choose a template (e.g., RHEL8) or define the VM manually.
4. Configure CPU, Memory, Boot source (PVC or URL), Network, and Storage.
5. Click Create and then Start to power on the VM.
Explanation:
1. Go to Administrator view Virtualization VirtualMachines.
2. Click Create > From Template or Create VirtualMachine.
3. Choose a template (e.g., RHEL8) or define the VM manually.
4. Configure CPU, Memory, Boot source (PVC or URL), Network, and Storage.
5. Click Create and then Start to power on the VM.
How do you attach a cloned disk to a new or existing VM?
Correct Answer:
See the Explanation.
Explanation:
1. Create DataVolume clone from source disk PVC.
2. Edit target VM YAML:
disks:
- name: new-disk
disk:
bus: virtio
volumes:
- name: new-disk
dataVolume:
name: cloned-disk
3. Apply changes.
4. Restart the VM.
5. Mount disk in guest OS.
Explanation:
1. Create DataVolume clone from source disk PVC.
2. Edit target VM YAML:
disks:
- name: new-disk
disk:
bus: virtio
volumes:
- name: new-disk
dataVolume:
name: cloned-disk
3. Apply changes.
4. Restart the VM.
5. Mount disk in guest OS.
How do you customize CPU and memory in a preconfigured template?
Correct Answer:
See the Explanation.
Explanation:
1. Use oc process with
parameters: -p MEMORY=4Gi
-p CPU=2
2. Or use the web console and edit Flavor settings.
3. Adjust limits under VM Details Resources.
4. Save and start VM.
5. Validate via oc describe vm <vm-name>.
Explanation:
1. Use oc process with
parameters: -p MEMORY=4Gi
-p CPU=2
2. Or use the web console and edit Flavor settings.
3. Adjust limits under VM Details Resources.
4. Save and start VM.
5. Validate via oc describe vm <vm-name>.
How do you expose multiple ports from a VM using a single service?
Correct Answer:
See the Explanation.
Explanation:
1. Define multiple ports in your service:
ports:
- name: ssh
port: 22
targetPort: 22
- name: http
port: 80
targetPort: 80
2. Apply the service.
3. Access each port individually using service DNS or NodePort.
4. Allows exposing multi-port applications.
5. Keeps networking simplified.
Explanation:
1. Define multiple ports in your service:
ports:
- name: ssh
port: 22
targetPort: 22
- name: http
port: 80
targetPort: 80
2. Apply the service.
3. Access each port individually using service DNS or NodePort.
4. Allows exposing multi-port applications.
5. Keeps networking simplified.
How do you delete a Velero backup and all associated snapshots?
Correct Answer:
See the Explanation.
Explanation:
1. Delete using CLI:
velero backup delete vm-backup --confirm
2. Delete related volume snapshots manually if needed.
3. Use: oc delete volumesnapshot <name>
4. Remove from object store if required.
Explanation:
1. Delete using CLI:
velero backup delete vm-backup --confirm
2. Delete related volume snapshots manually if needed.
3. Use: oc delete volumesnapshot <name>
4. Remove from object store if required.
How do you expose a VM using a ClusterIP service for internal-only access?
Correct Answer:
See the Explanation.
Explanation:
1. Ensure the VM is running and listening on the desired port (e.g., 80).
2. Label the VM:
oc label vm <vm-name> app=web-vm
3. Create a service:
apiVersion: v1
kind: Service
metadata:
name: web-vm-svc
spec:
selector:
kubevirt.io/domain: <vm-name>
ports:
- port: 80
targetPort: 80
4. Apply with oc apply -f svc.yaml
5. Test with curl web-vm-svc.default.svc.cluster.local
Explanation:
1. Ensure the VM is running and listening on the desired port (e.g., 80).
2. Label the VM:
oc label vm <vm-name> app=web-vm
3. Create a service:
apiVersion: v1
kind: Service
metadata:
name: web-vm-svc
spec:
selector:
kubevirt.io/domain: <vm-name>
ports:
- port: 80
targetPort: 80
4. Apply with oc apply -f svc.yaml
5. Test with curl web-vm-svc.default.svc.cluster.local
How do you connect a virtual machine to an iSCSI external storage volume using Multus?
Correct Answer:
See the Explanation.
Explanation:
1. Create a Multus NAD that connects to storage VLAN/network.
2. Attach this to the VM's spec as a second interface.
3. Inside VM:
o Install iSCSI initiator: yum install iscsi-initiator-utils
o Discover target: iscsiadm -m discovery -t sendtargets -p <target-ip>
o Login: iscsiadm -m node -T <target-name> -p <target-ip> --login
4. Confirm disk with lsblk.
Explanation:
1. Create a Multus NAD that connects to storage VLAN/network.
2. Attach this to the VM's spec as a second interface.
3. Inside VM:
o Install iSCSI initiator: yum install iscsi-initiator-utils
o Discover target: iscsiadm -m discovery -t sendtargets -p <target-ip>
o Login: iscsiadm -m node -T <target-name> -p <target-ip> --login
4. Confirm disk with lsblk.
How do you use an existing PVC as the root disk in a virtual machine?
Correct Answer:
See the Explanation.
Explanation:
1. Add to your VM spec:
volumes:
- name: rootdisk
persistentVolumeCla
im:
claimName: vm-root-disk
interfaces:
- name:
rootdisk
disk:
bus: virtio
2. Set volumeMount inside domain config.
3. Start the VM: virtctl start <vm>
4. Confirm disk is mounted inside the VM.
Explanation:
1. Add to your VM spec:
volumes:
- name: rootdisk
persistentVolumeCla
im:
claimName: vm-root-disk
interfaces:
- name:
rootdisk
disk:
bus: virtio
2. Set volumeMount inside domain config.
3. Start the VM: virtctl start <vm>
4. Confirm disk is mounted inside the VM.
How can you automate OpenShift Virtualization deployment via GitOps?
Correct Answer:
See the Explanation.
Explanation:
1. Store YAMLs for OperatorGroup and Subscription in Git repo.
2. Use ArgoCD or Flux to sync these resources to cluster.
3. Watch sync status in the GitOps tool.
4. Validate operator deployment in openshift-cnv.
5. Automate VM template creation via Git as well.
Explanation:
1. Store YAMLs for OperatorGroup and Subscription in Git repo.
2. Use ArgoCD or Flux to sync these resources to cluster.
3. Watch sync status in the GitOps tool.
4. Validate operator deployment in openshift-cnv.
5. Automate VM template creation via Git as well.
0
0
0
10
