diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 668e8087dde2ef3fc21c69605879fedd7803bfa4..36bf8d9faacb7b0bf99210ba72e267d1535f2292 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -128,6 +128,18 @@ {.name = "adapter-parent", \ .type = VSH_OT_STRING, \ .help = N_("adapter parent scsi_hostN to be used for underlying vHBA storage") \ + }, \ + {.name = "adapter-parent-wwnn", \ + .type = VSH_OT_STRING, \ + .help = N_("adapter parent scsi_hostN wwnn to be used for underlying vHBA storage") \ + }, \ + {.name = "adapter-parent-wwpn", \ + .type = VSH_OT_STRING, \ + .help = N_("adapter parent scsi_hostN wwpn to be used for underlying vHBA storage") \ + }, \ + {.name = "adapter-parent-fabric-wwn", \ + .type = VSH_OT_STRING, \ + .help = N_("adapter parent scsi_hostN fabric_wwn to be used for underlying vHBA storage") \ } virStoragePoolPtr @@ -309,7 +321,9 @@ virshBuildPoolXML(vshControl *ctl, *srcDev = NULL, *srcName = NULL, *srcFormat = NULL, *target = NULL, *authType = NULL, *authUsername = NULL, *secretUsage = NULL, *adapterName = NULL, *adapterParent = NULL, - *adapterWwnn = NULL, *adapterWwpn = NULL, *secretUUID = NULL; + *adapterWwnn = NULL, *adapterWwpn = NULL, *secretUUID = NULL, + *adapterParentWwnn = NULL, *adapterParentWwpn = NULL, + *adapterParentFabricWwn = NULL; virBuffer buf = VIR_BUFFER_INITIALIZER; VSH_EXCLUSIVE_OPTIONS("secret-usage", "secret-uuid"); @@ -332,7 +346,10 @@ virshBuildPoolXML(vshControl *ctl, vshCommandOptStringReq(ctl, cmd, "adapter-name", &adapterName) < 0 || vshCommandOptStringReq(ctl, cmd, "adapter-wwnn", &adapterWwnn) < 0 || vshCommandOptStringReq(ctl, cmd, "adapter-wwpn", &adapterWwpn) < 0 || - vshCommandOptStringReq(ctl, cmd, "adapter-parent", &adapterParent) < 0) + vshCommandOptStringReq(ctl, cmd, "adapter-parent", &adapterParent) < 0 || + vshCommandOptStringReq(ctl, cmd, "adapter-parent-wwnn", &adapterParentWwnn) < 0 || + vshCommandOptStringReq(ctl, cmd, "adapter-parent-wwpn", &adapterParentWwpn) < 0 || + vshCommandOptStringReq(ctl, cmd, "adapter-parent-fabric-wwn", &adapterParentFabricWwn) < 0) goto cleanup; virBufferAsprintf(&buf, "\n", type); @@ -353,6 +370,12 @@ virshBuildPoolXML(vshControl *ctl, virBufferAddLit(&buf, "\n", adapterWwnn, adapterWwpn); } else if (adapterName) { diff --git a/tools/virsh.pod b/tools/virsh.pod index 9fa483da377bae9b5d3daab9133fde5a1a012bad..20236885efa7934a21501b8e0655450967fce146 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -3768,10 +3768,17 @@ be provided, but not both. [I<--adapter-name name>] defines the scsi_hostN adapter name to be used for the scsi_host adapter type pool. -[I<--adapter-wwnn wwnn> I<--adapter-wwpn wwpn> [I<--adapter-parent parent>]] +[I<--adapter-wwnn wwnn> I<--adapter-wwpn wwpn> [I<--adapter-parent parent> | +I<--adapter-parent-wwnn parent_wwnn> I | +I<--adapter-parent-fabric-wwn parent_fabric_wwn>]] defines the wwnn and wwpn to be used for the fc_host adapter type pool. -The parent optionally provides the name of the scsi_hostN node device to -be used for the vHBA. +Optionally provide the parent scsi_hostN node device to be used for the +vHBA either by parent name, parent_wwnn and parent_wwpn, or parent_fabric_wwn. +The parent name could change between reboots if the hardware environment +changes, so providing the parent_wwnn and parent_wwpn ensure usage of the +same physical HBA even if the scsi_hostN node device changes. Usage of the +parent_fabric_wwn allows a bit more flexibility to choose an HBA on the +same storage fabric in order to define the pool. [I<--build>] [[I<--overwrite>] | [I<--no-overwrite>]] perform a B after creation in order to remove the need for a