// Module included in the following assemblies:
//
// * virt/virtual_machines/virt-specifying-instance-preference.adoc

:_mod-docs-content-type: PROCEDURE
[id="virt-using-flags-specify_{context}"]
= Using flags to specify instance types and preferences

Specify instance types and preferences by using flags.

.Prerequisites

* You must have an instance type, preference, or both on the cluster.

.Procedure

. To specify an instance type when creating a VM, use the `--instancetype` flag. To specify a preference, use the `--preference` flag. The following example includes both flags:

+
[source,terminal]
----
$ virtctl create vm --instancetype <my_instancetype> --preference <my_preference>
----

. Optional: To specify a namespaced instance type or preference, include the `kind` in the value passed to the `--instancetype` or `--preference` flag command. The namespaced instance type or preference must be in the same namespace you are creating the VM in. The following example includes flags for a namespaced instance type and a namespaced preference:

+
[source,terminal]
----
$ virtctl create vm --instancetype virtualmachineinstancetype/<my_instancetype> --preference virtualmachinepreference/<my_preference>
----