``create`` ========== .. contents:: :local: :depth: 1 Description ------------ Creates a new mount target in the specified compartment and subnet. You can associate a file system with a mount target only when they exist in the same availability domain. Instances can connect to mount targets in another availablity domain, but you might see higher latency than with instances in the same availability domain as the mount target. Mount targets have one or more private IP addresses that you can provide as the host portion of remote target parameters in client mount commands. These private IP addresses are listed in the privateIpIds property of the mount target and are highly available. Mount targets also consume additional IP addresses in their subnet. Do not use /30 or smaller subnets for mount target creation because they do not have sufficient available IP addresses. Allow at least three IP addresses for each mount target. For information about access control and compartments, see `Overview of the IAM Service `__. For information about availability domains, see `Regions and Availability Domains `__. To get a list of availability domains, use the `ListAvailabilityDomains` operation in the Identity and Access Management Service API. All Oracle Cloud Infrastructure Services resources, including mount targets, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (`OCID `__). When you create a resource, you can find its OCID in the response. You can also retrieve a resource's OCID by using a List API operation on that resource type, or by viewing the resource in the Console. Usage ----- .. code-block:: none oci fs mount-target create [OPTIONS] Required Parameters -------------------- .. option:: --availability-domain [text] The availability domain in which to create the mount target. Example: .. code-block:: python Uocm:PHX-AD-1 .. option:: --compartment-id, -c [text] The `OCID `__ of the compartment in which to create the mount target. .. option:: --subnet-id [text] The `OCID `__ of the subnet in which to create the mount target. Optional Parameters -------------------- .. option:: --defined-tags [complex type] Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see `Resource Tags `__. Example: `{"Operations": {"CostCenter": "42"}}` This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax. The :option:`--generate-param-json-input` option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, modifying it as needed and then passing it back in via the file:// syntax. .. option:: --display-name [text] A user-friendly name. It does not have to be unique, and it is changeable. Avoid entering confidential information. Example: .. code-block:: python My mount target .. option:: --freeform-tags [complex type] Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags `__. Example: `{"Department": "Finance"}` This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax. The :option:`--generate-param-json-input` option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, modifying it as needed and then passing it back in via the file:// syntax. .. option:: --from-json [text] Provide input to this command as a JSON document from a file using the file://path-to/file syntax. The :option:`--generate-full-command-json-input` option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id --> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array. Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used. For examples on usage of this option, please see our "using CLI with advanced JSON options" link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions .. option:: --hostname-label [text] The hostname for the mount target's IP address, used for DNS resolution. The value is the hostname portion of the private IP address's fully qualified domain name (FQDN). For example, `files-1` in the FQDN `files-1.subnet123.vcn1.oraclevcn.com`. Must be unique across all VNICs in the subnet and comply with `RFC 952 `__ and `RFC 1123 `__. Note: This attribute value is stored in the `PrivateIp `__ resource, not in the `mountTarget` resource. To update the `hostnameLabel`, use `GetMountTarget` to obtain the `OCIDs `__ of the mount target's private IPs (`privateIpIds`). Then, you can use `UpdatePrivateIp `__ to update the `hostnameLabel` value. For more information, see `DNS in Your Virtual Cloud Network `__. Example: .. code-block:: python files-1 .. option:: --idmap-type [text] The method used to map a Unix UID to secondary groups, if any. .. option:: --ip-address [text] A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Note: This attribute value is stored in the `PrivateIp `__ resource, not in the `mountTarget` resource. To update the `ipAddress`, use `GetMountTarget` to obtain the `OCIDs `__ of the mount target's private IPs (`privateIpIds`). Then, you can use `UpdatePrivateIp `__ to update the `ipAddress` value. Example: .. code-block:: python 10.0.3.3 .. option:: --kerberos [complex type] This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax. The :option:`--generate-param-json-input` option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, modifying it as needed and then passing it back in via the file:// syntax. .. option:: --ldap-idmap [complex type] This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax. The :option:`--generate-param-json-input` option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, modifying it as needed and then passing it back in via the file:// syntax. .. option:: --max-wait-seconds [integer] The maximum time to wait for the resource to reach the lifecycle state defined by ``--wait-for-state``. Defaults to 1200 seconds. .. option:: --nsg-ids [complex type] A list of Network Security Group `OCIDs `__ associated with this mount target. A maximum of 5 is allowed. Setting this to an empty array after the list is created removes the mount target from all NSGs. For more information about NSGs, see `Security Rules `__. This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax. The :option:`--generate-param-json-input` option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, modifying it as needed and then passing it back in via the file:// syntax. .. option:: --wait-for-state [text] This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, ``--wait-for-state`` SUCCEEDED ``--wait-for-state`` FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned. Accepted values are: .. code-block:: py ACTIVE, CREATING, DELETED, DELETING, FAILED .. option:: --wait-interval-seconds [integer] Check every ``--wait-interval-seconds`` to see whether the resource has reached the lifecycle state defined by ``--wait-for-state``. Defaults to 30 seconds. Global Parameters ------------------ Use ``oci --help`` for help on global parameters. :option:`--auth-purpose`, :option:`--auth`, :option:`--cert-bundle`, :option:`--cli-auto-prompt`, :option:`--cli-rc-file`, :option:`--config-file`, :option:`--connection-timeout`, :option:`--debug`, :option:`--defaults-file`, :option:`--endpoint`, :option:`--generate-full-command-json-input`, :option:`--generate-param-json-input`, :option:`--help`, :option:`--latest-version`, :option:`--max-retries`, :option:`--no-retry`, :option:`--opc-client-request-id`, :option:`--opc-request-id`, :option:`--output`, :option:`--profile`, :option:`--proxy`, :option:`--query`, :option:`--raw-output`, :option:`--read-timeout`, :option:`--realm-specific-endpoint`, :option:`--region`, :option:`--release-info`, :option:`--request-id`, :option:`--version`, :option:`-?`, :option:`-d`, :option:`-h`, :option:`-i`, :option:`-v` Example using required parameter ------------------ Copy the following CLI commands into a file named example.sh. Run the command by typing "bash example.sh" and replacing the example parameters with your own. Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up `the OCI configuration `__ and `appropriate security policies `__ before trying the examples. .. code-block:: none :class: copy-code-block export availability_domain= # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/fs/mount-target/create.html#cmdoption-availability-domain export compartment_id= # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/fs/mount-target/create.html#cmdoption-compartment-id export subnet_id= # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/fs/mount-target/create.html#cmdoption-subnet-id oci fs mount-target create --availability-domain $availability_domain --compartment-id $compartment_id --subnet-id $subnet_id