Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion ansible/roles/vm_set/tasks/add_topo.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@

# The PTF image built from different branches may be incompatible. The ptf_imagetag variable added here is to
# support using different PTF images for different branches. When the ptf_imagetag variable is not specified,
# the PTF image with default "201811" tag will be used in this sonic-mgmt 201811 branch. When a different PTF
# image version is required, we can specify a different value for the ptf_imagetag variable somewhere to
# override the default value, for example, specify from command line:
# ./testbed-cli.sh add-topo <testbed_name>-<topo> vault -e ptf_imagetag=myversion
# By using this practice, we suggest to add different tags for different PTF image versions in docker registry.
# And we suggest to add tag "201811" for PTF image built from the 201811 branch.
- name: Set default value for ptf_imagetag
set_fact:
ptf_imagetag: "201811"
when: ptf_imagetag is not defined

- name: Create a docker container ptf_{{ vm_set_name }}
docker:
registry: "{{ docker_registry_host }}"
username: "{{ docker_registry_username }}"
password: "{{ docker_registry_password }}"
name: ptf_{{ vm_set_name }}
image: "{{ docker_registry_host }}/{{ ptf_imagename }}"
image: "{{ docker_registry_host }}/{{ ptf_imagename }}:{{ ptf_imagetag }}"
pull: always
state: reloaded
net: none
Expand Down
2 changes: 2 additions & 0 deletions ansible/testbed-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ function usage
echo " $0 start-vms server-name vault-password-file -e autostart=yes"
echo "To stop VMs on a server: $0 stop-vms 'server-name' ~/.password"
echo "To deploy a topology on a server: $0 add-topo 'topo-name' ~/.password"
echo " Optional argument for add-topo:"
echo " -e ptf_imagetag=<tag> # Use PTF image with specified tag for creating PTF container"
echo "To remove a topology on a server: $0 remove-topo 'topo-name' ~/.password"
echo "To renumber a topology on a server: $0 renumber-topo 'topo-name' ~/.password"
echo "To connect a topology: $0 connect-topo 'topo-name' ~/.password"
Expand Down