Courseiva
mediumMultiple ChoiceObjective-mapped

200-901 Practice Question: Is automating the deployment of a new VLAN across…

A network engineer is automating the deployment of a new VLAN across multiple Cisco switches using Ansible. The engineer has written a playbook that uses the ios_vlan module to create VLAN 100 with name 'Users'. The playbook runs successfully on the first switch but fails on the second switch with the error message: 'VLAN name is already in use'. The engineer checks the second switch and confirms that VLAN 100 does not exist, but a different VLAN with the name 'Users' exists. The engineer wants to ensure that the playbook creates VLAN 100 with the exact name 'Users' only if it does not already exist, and without conflicting with existing VLANs. Which approach should the engineer take?

⚠ Common exam trap

The trap is that the ios_vlan module with state=present will create or update a VLAN by ID, but if the name is already assigned to a different VLAN ID, the operation will fail. This does not mean the module is not idempotent; it simply means the network device enforces unique VLAN names. The engineer should use the module and handle the failure, or first verify name availability.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

First use the ios_command module to run 'show vlan name Users' and then conditionally create VLAN 100 if no output is returned.

The correct approach is to first verify that the VLAN name 'Users' is not already in use on the switch before attempting to create VLAN 100. Using the ios_command module to execute 'show vlan name Users' returns output only if a VLAN with that name exists. If no output is returned, the name is available, and the engineer can then proceed to create VLAN 100 with the name 'Users' using the ios_vlan module. This conditional approach avoids the 'VLAN name is already in use' error and ensures idempotency without conflicts. Option A incorrectly assumes the ios_vlan module will update an existing VLAN's name, but actually it will fail if the name is assigned to a different VLAN ID. Options C and D do not solve the name conflict or meet the requirement.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use the ios_vlan module with parameters vlan_id=100 and name='Users' and set state=present. The module will create the VLAN if it does not exist or update the name if it exists with a different name.

    Why it's wrong here

    This approach will fail because the ios_vlan module cannot change the name of a different VLAN ID; if another VLAN already has the name 'Users', the operation will produce the 'VLAN name is already in use' error. Therefore, it does not resolve the conflict.

  • First use the ios_command module to run 'show vlan name Users' and then conditionally create VLAN 100 if no output is returned.

    Why this is correct

    By first checking if any VLAN has the name 'Users' using 'show vlan name Users', the engineer can conditionally create VLAN 100 only when the name is free. This avoids the name conflict and ensures the desired outcome.

  • Use the ios_config module to directly apply the configuration 'vlan 100\n name Users' and then use the 'parents' directive to ensure idempotency.

    Why it's wrong here

    Directly applying the configuration with ios_config module still results in the same error because the network device enforces unique VLAN names. The 'parents' directive does not prevent this.

  • Use the ios_vlan module with vlan_id=100 and state=present, but omit the name parameter.

    Why it's wrong here

    Omitting the name parameter creates VLAN 100 without the required name 'Users', so it does not meet the requirement.

Visual reference

Switch VLAN 10 Sales (192.168.10.0/24) PC-A PC-B VLAN 20 HR (192.168.20.0/24) PC-C PC-D Router VLANs isolate traffic — inter-VLAN routing requires a Layer 3 device

About these practice questions

One of 989 original 200-901 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.