Skip to content
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

libvirt_vm: enablement of SAN based guest with LUN id #1593

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions shared/cfg/guest-hw.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,18 @@ variants image_backend:
image_raw_device = yes
storage_type = iscsi
force_create_image = no
- san:
# Please update image_name and images_base_dir params based on your test env
only raw
storage_type = "san"
drive_format = "scsi"
driver_name = "qemu"
images_base_dir = "/dev/disk/by-id"
image_name = "scsi-360050768028211d8b0000000000000b9"
image_format = "raw"
image_device = "lun"
image_raw_device = yes
force_create_image = no
- remote_nfs:
storage_type = nfs
nfs_mount_dir = /mnt/nfs_images
Expand Down
9 changes: 6 additions & 3 deletions virttest/libvirt_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ def check_controller(virt_install_cmd_line, controller):

def add_drive(help_text, filename, pool=None, vol=None, device=None,
bus=None, perms=None, size=None, sparse=False,
cache=None, fmt=None):
cache=None, fmt=None, driver_name=None):
cmd = " --disk"
if filename:
cmd += " path=%s" % filename
Expand All @@ -749,6 +749,8 @@ def add_drive(help_text, filename, pool=None, vol=None, device=None,
cmd += ",format=%s" % fmt
if cache:
cmd += ",cache=%s" % cache
if driver_name:
cmd += ",driver_name=%s" % driver_name
return cmd

def add_floppy(help_text, filename):
Expand Down Expand Up @@ -1228,13 +1230,14 @@ def add_cputune(vcpu_cputune=""):
filename,
None,
None,
None,
image_params.get("image_device"),
_drive_format,
None,
image_params.get("image_size"),
image_params.get("drive_sparse"),
image_params.get("drive_cache"),
image_params.get("image_format"))
image_params.get("image_format"),
image_params.get("driver_name"))

unattended_integrated = (params.get('unattended_delivery_method') !=
'integrated')
Expand Down
3 changes: 2 additions & 1 deletion virttest/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def cmp(x, y):
image_format = params.get("image_format", "qcow2")
if params.get("image_raw_device") == "yes":
return image_name
if image_format:
storage_type = params.get("storage_type")
if image_format and storage_type != "san":
image_filename = "%s.%s" % (image_name, image_format)
else:
image_filename = image_name
Expand Down