Debian Codegraph @

docs/cli/inv-from-cvp.md

raw symbols SCIP
1 ---
2 title: Create an Inventory from CloudVision
3 hide:
4 - tags
5 tags:
6 - CLI
7 - Inventory
8 ---
9
10 <!--
11 ~ Copyright (c) 2023-2026 Arista Networks, Inc.
12 ~ Use of this source code is governed by the Apache License 2.0
13 ~ that can be found in the LICENSE file.
14 -->
15
16 In large setups, it might be beneficial to construct your inventory based on CloudVision. The `from-cvp` entrypoint of the `get` command enables the user to create an ANTA inventory from CloudVision.
17
18 !!! info
19 The current implementation only works with on-premises CloudVision instances, not with CloudVision as a Service (CVaaS).
20
21 ## Command overview
22
23 ```bash
24 --8<-- "anta_get_fromcvp_help.txt"
25 ```
26
27 The output is an inventory where the name of the container is added as a tag for each host:
28
29 ```yaml
30 anta_inventory:
31 hosts:
32 - host: 192.168.0.13
33 name: leaf2
34 tags:
35 - pod1
36 - host: 192.168.0.15
37 name: leaf4
38 tags:
39 - pod2
40 ```
41
42 !!! warning
43 The current implementation only considers devices directly attached to a specific container when using the `--cvp-container` option.
44
45 ## Creating an inventory from multiple containers
46
47 If you need to create an inventory from multiple containers, you can use a bash command and then manually concatenate files to create a single inventory file:
48
49 ```bash
50 $ for container in pod01 pod02 spines; do anta get from-cvp -ip <cvp-ip> -u cvpadmin -p cvpadmin -c $container -d test-inventory; done
51
52 [12:25:35] INFO Getting auth token from cvp.as73.inetsix.net for user tom
53 [12:25:36] INFO Creating inventory folder /home/tom/Projects/arista/network-test-automation/test-inventory
54 WARNING Using the new api_token parameter. This will override usage of the cvaas_token parameter if both are provided. This is because api_token and cvaas_token parameters
55 are for the same use case and api_token is more generic
56 INFO Connected to CVP cvp.as73.inetsix.net
57
58
59 [12:25:37] INFO Getting auth token from cvp.as73.inetsix.net for user tom
60 [12:25:38] WARNING Using the new api_token parameter. This will override usage of the cvaas_token parameter if both are provided. This is because api_token and cvaas_token parameters
61 are for the same use case and api_token is more generic
62 INFO Connected to CVP cvp.as73.inetsix.net
63
64
65 [12:25:38] INFO Getting auth token from cvp.as73.inetsix.net for user tom
66 [12:25:39] WARNING Using the new api_token parameter. This will override usage of the cvaas_token parameter if both are provided. This is because api_token and cvaas_token parameters
67 are for the same use case and api_token is more generic
68 INFO Connected to CVP cvp.as73.inetsix.net
69
70 INFO Inventory file has been created in /home/tom/Projects/arista/network-test-automation/test-inventory/inventory-spines.yml
71 ```