Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Virtual device tagging client support
In order to support virtual device role tagging that was introduced in microversion 2.32, this patch adds: * The 'tag' key to the --nic flag when booting an instance. * The 'tag' key to the --block-device flag when booting an instance. Change-Id: I1866c670994254bc2849b494e318f4ff8cc44eb7 Implements: blueprint virt-device-role-tagging
- Loading branch information
Showing
7 changed files
with
245 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright (C) 2016, Red Hat, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
import uuid | ||
|
||
from novaclient.tests.functional import base | ||
|
||
|
||
class TestDeviceTaggingCLI(base.ClientTestBase): | ||
|
||
COMPUTE_API_VERSION = "2.32" | ||
|
||
def test_boot_server_with_tagged_devices(self): | ||
server_info = self.nova('boot', params=( | ||
'%(name)s --flavor %(flavor)s --poll ' | ||
'--nic net-id=%(net-uuid)s,tag=foo ' | ||
'--block-device ' | ||
'source=image,dest=volume,id=%(image)s,size=1,' | ||
'bootindex=0,tag=bar' % {'name': str(uuid.uuid4()), | ||
'flavor': self.flavor.id, | ||
'net-uuid': self.network.id, | ||
'image': self.image.id})) | ||
server_id = self._get_value_from_the_table(server_info, 'id') | ||
self.client.servers.delete(server_id) | ||
self.wait_for_resource_delete(server_id, self.client.servers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
releasenotes/notes/microversion-v2_32-7947430cc2415597.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
features: | ||
- | | ||
The 2.32 microverison adds support for virtual device | ||
role tagging. Device role tagging is an answer to the | ||
question 'Which device is which?' from inside the guest. | ||
When booting an instance, an optional arbitrary 'tag' | ||
parameter can be set on virtual network interfaces | ||
and/or block device mappings. This tag is exposed to the | ||
instance through the metadata API and on the config | ||
drive. Each tagged virtual network interface is listed | ||
along with information about the virtual hardware, such | ||
as bus type (ex: PCI), bus address (ex: 0000:00:02.0), | ||
and MAC address. For tagged block devices, the exposed | ||
hardware metadata includes the bus (ex: SCSI), bus | ||
address (ex: 1:0:2:0) and serial number. | ||
In the client, device tagging is exposed with the 'tag' | ||
key in the --block-device and --nic boot arguments. | ||
issues: | ||
- | | ||
While not an issue with the client itself, it should be | ||
noted that if a tagged network interface or volume is | ||
detached from a guest, its metadata will continue to | ||
appear in the config drive, even after instance reboot. |