.. _vol.action.service_and_volume_object_actions.switch:

:cmd:`om vol switch`
--------------------

Stop the running failover service instance and start the instance on the peer node specified by :opt:`--to <nodename>`.

:opt:`--color=<string>`
+++++++++++++++++++++++

	Colorize output. Possible values are:
	
	* auto: guess based on tty presence
	* always|yes: always colorize
	* never|no: never colorize

:opt:`--daemon`
+++++++++++++++

	A flag inhibiting the command daemonization. Set by the daemonization routine.

:opt:`--debug`
++++++++++++++

	Increase stream and file log verbosity up to the debug level.

:opt:`--disable-rollback`
+++++++++++++++++++++++++

	If set, don't try to rollback resources activated before a start action interrupts on error.

:opt:`--env`
++++++++++++

	Export the uppercased variable in the os environment.
	
	With the create action only, set a env section parameter in the service configuration file. Multiple ``--env <key>=<val>`` can be specified. For all other actions.

:opt:`--interval=<int>`
+++++++++++++++++++++++

	with --watch, set the refresh interval. defaults to 0, to refresh on event only.

:opt:`--local`
++++++++++++++

	Execute the service action on the local service instances only, ignoring cluster-wide considerations.

:opt:`--namespace=<string>`
+++++++++++++++++++++++++++

	The namespace to switch to for the action. Namespaces are cluster partitions. A default namespace can be set for the session setting the OSVC_NAMESPACE environment variable.

:opt:`--node=<string>`
++++++++++++++++++++++

	The node to send a request to. If not specified the local node is targeted.

:opt:`--stats`
++++++++++++++

	Show system resources usage metrics and refresh the information every --interval.

:opt:`--status=<string>`
++++++++++++++++++++++++

	Operate only on service with a local instance in the specified availability status (up, down, warn, ...).

:opt:`--time=<string>`
++++++++++++++++++++++

	A duration expression like ``1m5s``. The maximum wait time for an async action to finish. Default is 300 seconds.

:opt:`--to=<string>`
++++++++++++++++++++

	The remote node to start or migrate the service to. Or the target number of instance to scale to.

:opt:`--wait`
+++++++++++++

	Wait for asynchronous action termination.

:opt:`--waitlock=<string>`
++++++++++++++++++++++++++

	A duration expression like ``5s``. The maximum wait time when acquiring the service action lock.

:opt:`-h, --help`
+++++++++++++++++

	Show this help message and exit.

:opt:`-p, --parallel`
+++++++++++++++++++++

	Start actions on specified services in parallel. :kw:`max_parallel` in node.conf limits the number of parallel running subprocesses.

:opt:`-s, VAL, --service=<string>`
++++++++++++++++++++++++++++++++++

	A service selector expression ``[!]<expr>[<sep>[!]<expr>]`` where:
	
	- ``!`` is the expression negation operator
	
	- ``<sep>`` can be:
	
	  - ``,`` OR expressions
	
	  - ``+`` AND expressions
	
	- ``<expr>`` can be:
	
	  - a shell glob on service names
	
	  - ``<param><op><value>`` where:
	
	    - ``<param>`` can be:
	
	      - ``<rid>:``
	
	      - ``<group>:``
	
	      - ``<rid>.<key>``
	
	      - ``<group>.<key>``
	
	      - ``<single value jsonpath expression on the $.monitor.services.<path> dictionary extended under the 'nodes' key by each instance 'status' and 'config' data>``
	
	    - ``<op>`` can be:
	
	      - ``<``  ``>``  ``<=``  ``>=``  ``=``
	
	      - ``~`` the string or any list element matches the regexp value
	
	      - ``~=`` the string matches regexp value or any list element is the value
	
	Examples:
	
	- ``*dns,ha*+app.timeout>1``
	
	- ``ip:+task:``
	
	- ``!*excluded``
	
	- ``$.avail=warn``
	
	- ``$.nodes.*.status.avail=warn``
	
	Note:
	
	- ``!`` usage requires single quoting the expression to prevent shell history expansion

:opt:`-w, --watch`
++++++++++++++++++

	refresh the information every --interval.