Este contenido no está disponible en el idioma seleccionado.
Chapter 20. Identifying virtual devices with tags
20.1. Overview of virtual device tagging Copiar enlaceEnlace copiado en el portapapeles!
If you launch an instance with multiple network interfaces or block devices, you can use device tagging to communicate the intended role of each device to the instance operating system. Tags are assigned to devices at instance boot time, and are available to the instance operating system through the metadata API and the configuration drive (if enabled).
The tags are set using the following parameters:
-
--block-device tag=device metadata -
--nic tag=device metadata
20.2. Tagging virtual devices Copiar enlaceEnlace copiado en el portapapeles!
To tag virtual devices, use the tag parameters,
--block-deviceand--nic, when creating instances.Here is an example:
nova boot test-vm --flavor m1.tiny --image cirros \ --nic net-id=55411ca3-83dd-4036-9158-bf4a6b8fb5ce,tag=nfv1 \ --block-device id=b8c9bef7-aa1d-4bf4-a14d-17674b370e13,bus=virtio,tag=database-server NFVappServer
$ nova boot test-vm --flavor m1.tiny --image cirros \ --nic net-id=55411ca3-83dd-4036-9158-bf4a6b8fb5ce,tag=nfv1 \ --block-device id=b8c9bef7-aa1d-4bf4-a14d-17674b370e13,bus=virtio,tag=database-server NFVappServerCopy to Clipboard Copied! Toggle word wrap Toggle overflow The resulting tags are added to the existing instance metadata and are available through both the metadata API, and on the configuration drive.
In this example, the following devices section populates the metadata:
Sample contents of the meta_data.json file:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The device tag metadata is available using
GET /openstack/latest/meta_data.jsonfrom the metadata API.If the configuration drive is enabled, and mounted under /configdrive in the instance operating system, the metadata is also present in /configdrive/openstack/latest/meta_data.json.