-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add storage and image management support #3864
base: master
Are you sure you want to change the base?
Conversation
9779000
to
d262029
Compare
5b92551
to
6b3310e
Compare
8fcab3f
to
342d7e8
Compare
d0a1ebe
to
5b7c04b
Compare
1c9b232
to
e8d1295
Compare
648e892
to
79c172d
Compare
a21eb6d
to
11452bb
Compare
e90dc16
to
a4cc6ce
Compare
9b28459
to
fe6f5c2
Compare
avocado_vt/plugins/vt_cluster.py
Outdated
teardown_resmgr() | ||
vt_imgr.teardown() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move out of the blocker for
"uuid": "uuid-sn" | ||
"name": "sn", | ||
"type": "qemu", | ||
"topology": {"chain": ["base", "sn"]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"topology": {"chain": ["base", "sn"]} | |
"topology": {"$type: chain; flat", ["$tag: ", "sn"]} |
virttest/vt_utils/image/qemu.py
Outdated
return volume_opts_getter(volume_config) | ||
|
||
|
||
def get_image_opts(virt_image_config): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the argument virt_image_config
config = super()._define_config_legacy(resource_name, resource_params) | ||
config["meta"].update({ | ||
"type": cls._RESOURCE_TYPE, | ||
"volume-type": cls.volume_type, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[stdlog] 2024-07-25 11:25:37,177 avocado.virttest.vt_vmm.objects.instance_spec_qemu instance_spec_qe L1196 DEBUG| --> disk source: {'meta': {'uuid': 'fec24fc199ff4b54b9f334403b13036a', 'name': 'image1', 'type': 'qemu', 'topology': {'none': ['image1']}}, 'spec': {'virt-images': {'image1': {'meta': {'name': 'image1'}, 'spec': {'format': 'qcow2', 'volume': {'meta': {'name': 'image1', 'uuid': 'bbe8f7b1409e402d9344099bc6908c9f', 'type': 'volume', 'pool': {'meta': {'name': 'dir_pool1', 'uuid': 'ebbbefc61517466baee18cd07ee9fbf7', 'type': 'filesystem', 'access': {'nodes': ['host1']}}, 'spec': {'path': '/home/'}}, 'allocated': False, 'bindings': {'host1': '5b1b03d28aea4f6584b9e675085f4094'}, 'volume-type': <bound method _Volume.volume_type of <class 'virttest.vt_resmgr.resources.storage.dir.dir_resources._DirFileVolume'>>
, 'raw': False}, 'spec': {'size': '21474836480', 'allocation': 0, 'uri': '/home/images/rhel950-64-virtio-scsi-ovmf.qcow2', 'filename': 'images/rhel950-64-virtio-scsi-ovmf.qcow2'}}, 'backing': None, 'cluster-size': None, 'lazy-refcounts': None, 'compat': None, 'preallocation': None, 'extent_size_hint': None, 'compression_type': None}}}}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
'meta':
{
'uuid': 'fec24fc199ff4b54b9f334403b13036a',
'name': 'image1',
'type': 'qemu',
'topology': {'none': ['image1']}
},
'spec':
{
'virt-images':
{
'image1':
{
'meta': {'name': 'image1'},
'spec':
{
'format': 'qcow2',
'volume':
{
'meta':
{
'name': 'image1',
'uuid': 'bbe8f7b1409e402d9344099bc6908c9f',
'type': 'volume',
'pool':
{
'meta':
{
'name': 'dir_pool1',
'uuid': 'ebbbefc61517466baee18cd07ee9fbf7',
'type': 'filesystem',
'access': {'nodes': ['host1']}
},
'spec': {'path': '/home/'}
},
'allocated': False,
'bindings': {'host1': '5b1b03d28aea4f6584b9e675085f4094'},
'volume-type': <bound method _Volume.volume_type of <class 'virttest.vt_resmgr.resources.storage.dir.dir_resources._DirFileVolume'>>,
'raw': False
},
'spec':
{
'size': '21474836480',
'allocation': 0,
'uri': '/home/images/rhel950-64-virtio-scsi-ovmf.qcow2',
'filename':
'images/rhel950-64-virtio-scsi-ovmf.qcow2'
}
},
'backing': None,
'cluster-size': None,
'lazy-refcounts': None,
'compat': None,
'preallocation': None,
'extent_size_hint': None,
'compression_type': None
}
}
}
}
}
config = super()._define_config_legacy(resource_name, resource_params) | ||
config["meta"].update({ | ||
"type": cls._RESOURCE_TYPE, | ||
"volume-type": cls.volume_type, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"volume-type": cls.volume_type, | |
"volume-type": cls.volume_type(), |
@classmethod | ||
def define_config(cls, pool_name, pool_params): | ||
config = super().define_config(pool_name, pool_params) | ||
path = pool_params.get("path") or os.path.join(get_data_dir(), "images") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should consider the situation with the remote node if we do not specify the pool path in the cluser.json
pool_conn = self._pool_connections[backing.source_pool_id] | ||
cmd, arguments = new_config.popitem() | ||
handler = backing.get_update_handler(cmd) | ||
ret = handler(pool_conn, arguments) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ret = handler(pool_conn, arguments) | |
if cmd == "sync": | |
ret = handler(pool_conn) | |
else: | |
ret = handler(pool_conn, arguments) |
image_name, image_params | ||
) | ||
|
||
config = super()._define_config_legacy(image_name, params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config = super()._define_config_legacy(image_name, params) | |
config = super()._define_config_legacy(image_name, params) | |
image_params = params.object_params(image_name) | |
config["meta"]["user"] = image_params.get(f"image_owner_{image_name}") |
self._pools = dict() | ||
self._default_pools = list() | ||
if os.path.isfile(RESMGR_ENV_FILENAME): | ||
self._load() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._load() | |
self._load() | |
else: | |
self._dump_data = {"pools": dict()} |
|
||
def cleanup(self): | ||
LOG.info(f"Cleanup the resource manager") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._dump_data = {"pools": dict()} |
Signed-off-by: Yongxue Hong <[email protected]>
3c3ca0a
to
1309ce1
Compare
c2d6044
to
1fef734
Compare
854d1cc
to
71a8661
Compare
Signed-off-by: Zhenchao Liu <[email protected]>
No description provided.