.type = VSH_OT_STRING,
.help = N_("format for underlying storage")
},
+ {.name = "auth-type",
+ .type = VSH_OT_STRING,
+ .help = N_("auth type to be used for underlying storage")
+ },
+ {.name = "auth-username",
+ .type = VSH_OT_STRING,
+ .help = N_("auth username to be used for underlying storage")
+ },
+ {.name = "secret-usage",
+ .type = VSH_OT_STRING,
+ .help = N_("auth secret usage to be used for underlying storage")
+ },
{.name = NULL}
};
{
const char *name = NULL, *type = NULL, *srcHost = NULL, *srcPath = NULL,
*srcDev = NULL, *srcName = NULL, *srcFormat = NULL,
- *target = NULL;
+ *target = NULL, *authType = NULL, *authUsername = NULL,
+ *secretUsage = NULL;
virBuffer buf = VIR_BUFFER_INITIALIZER;
if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
vshCommandOptStringReq(ctl, cmd, "source-dev", &srcDev) < 0 ||
vshCommandOptStringReq(ctl, cmd, "source-name", &srcName) < 0 ||
vshCommandOptStringReq(ctl, cmd, "source-format", &srcFormat) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "target", &target) < 0)
+ vshCommandOptStringReq(ctl, cmd, "target", &target) < 0 ||
+ vshCommandOptStringReq(ctl, cmd, "auth-type", &authType) < 0 ||
+ vshCommandOptStringReq(ctl, cmd, "auth-username", &authUsername) < 0 ||
+ vshCommandOptStringReq(ctl, cmd, "secret-usage", &secretUsage) < 0)
goto cleanup;
virBufferAsprintf(&buf, "<pool type='%s'>\n", type);
virBufferAsprintf(&buf, "<dir path='%s'/>\n", srcPath);
if (srcDev)
virBufferAsprintf(&buf, "<device path='%s'/>\n", srcDev);
+ if (authType && authUsername && secretUsage) {
+ virBufferAsprintf(&buf, "<auth type='%s' username='%s'>\n",
+ authType, authUsername);
+ virBufferAdjustIndent(&buf, 2);
+ virBufferAsprintf(&buf, "<secret usage='%s'/>\n", secretUsage);
+ virBufferAdjustIndent(&buf, -2);
+ virBufferAddLit(&buf, "</auth>\n");
+ }
if (srcFormat)
virBufferAsprintf(&buf, "<format type='%s'/>\n", srcFormat);
if (srcName)
=item B<pool-create-as> I<name> I<type> [I<--print-xml>]
[I<--source-host hostname>] [I<--source-path path>] [I<--source-dev path>]
[I<--source-name name>] [I<--target path>] [I<--source-format format>]
+[I<--auth-type authtype> I<--auth-username username> I<--secret-usage usage>]
Create and start a pool object I<name> from the raw parameters. If
I<--print-xml> is specified, then print the XML of the pool object
[I<--source-format format>] provides information about the format of the
pool (pool types fs, netfs, disk, logical).
+[I<--auth-type authtype> I<--auth-username username> I<--secret-usage usage>]
+provides the elements required to generate authentication credentials for
+the storage pool. The I<authtype> is either chap for iscsi I<type> pools or
+ceph for rbd I<type> pools.
+
=item B<pool-define> I<file>
Create, but do not start, a pool object from the XML I<file>.
=item B<pool-define-as> I<name> I<type> [I<--print-xml>]
[I<--source-host hostname>] [I<--source-path path>] [I<--source-dev path>]
[I<--source-name name>] [I<--target path>] [I<--source-format format>]
+[I<--auth-type authtype> I<--auth-username username> I<--secret-usage usage>]
Create, but do not start, a pool object I<name> from the raw parameters. If
I<--print-xml> is specified, then print the XML of the pool object