</cmdsynopsis>
<para>
- Starts one or more instances, depending on the
- <option>--by-*</option> mode. The four available modes are:
+ Starts one or more instances, depending on the following
+ options. The four available modes are:
<variablelist>
<varlistentry>
<term><option>--instance</option></term>
</para>
<para>
- Note that although you can pass more than one
- <option>--by-</option> option, the last one wins, so in
- order to guarantee the desired result, don't pass more than
- one such option.
+ Note that although you can pass more than one selection
+ option, the last one wins, so in order to guarantee the
+ desired result, don't pass more than one such option.
</para>
<para>
<screen>
# gnt-instance start instance1.example.com
# gnt-instance start --extra single test1.example.com
-# gnt-instance start --by-node node1.example.com node2.example.com
-# gnt-instance start --by-cluster
+# gnt-instance start --node node1.example.com node2.example.com
+# gnt-instance start --all
</screen>
</para>
</refsect3>
Example:
<screen>
# gnt-instance shutdown instance1.example.com
-# gnt-instance shutdown --by-cluster
+# gnt-instance shutdown --all
</screen>
</para>
</refsect3>
if opts.multi_mode is None:
opts.multi_mode = _SHUTDOWN_INSTANCES
inames = _ExpandMultiNames(opts.multi_mode, args)
+ if not inames:
+ raise errors.OpPrereqError("Selection filter does not match any instances")
multi_on = opts.multi_mode != _SHUTDOWN_INSTANCES or len(inames) > 1
if not (opts.force_multi or not multi_on
or _ConfirmOperation(inames, "startup")):
if opts.multi_mode is None:
opts.multi_mode = _SHUTDOWN_INSTANCES
inames = _ExpandMultiNames(opts.multi_mode, args)
+ if not inames:
+ raise errors.OpPrereqError("Selection filter does not match any instances")
multi_on = opts.multi_mode != _SHUTDOWN_INSTANCES or len(inames) > 1
if not (opts.force_multi or not multi_on
or _ConfirmOperation(inames, "reboot")):
if opts.multi_mode is None:
opts.multi_mode = _SHUTDOWN_INSTANCES
inames = _ExpandMultiNames(opts.multi_mode, args)
+ if not inames:
+ raise errors.OpPrereqError("Selection filter does not match any instances")
multi_on = opts.multi_mode != _SHUTDOWN_INSTANCES or len(inames) > 1
if not (opts.force_multi or not multi_on
or _ConfirmOperation(inames, "shutdown")):
opts.multi_mode = _SHUTDOWN_INSTANCES
inames = _ExpandMultiNames(opts.multi_mode, args)
if not inames:
- logger.ToStderr("No instances match the selected options")
- return 1
+ raise errors.OpPrereqError("Selection filter does not match any instances")
multi_on = opts.multi_mode != _SHUTDOWN_INSTANCES or len(inames) > 1
if not (opts.force_multi or not multi_on
or _ConfirmOperation(inames, "failover (including shutdown)")):