view create

Prev Next

This command creates a view, which is a resource location exposed to data clients. A view can be exposed to NFSv3, NFSv4.1 or SMB clients or to both NFSv3 and SMB clients or to both NFSv3 and NFSv4 clients. Also, a tabular data view can be exposed to third-party database query engines.

Usage

view create --path PATH
            --protocols PROTOCOLS
            --policy-id ID
            [--tenant-id TENANT_ID]
            [--alias ALIAS]
            [--bucket BUCKET]
            [--bucket-owner BUCKET_OWNER]
            [--bucket-creators BUCKET_CREATORS]
            [--bucket-creators-groups BUCKET_CREATORS_GROUPS]
            [--create-dir]
            [--enable-global-sync]
            [--enable-live-monitoring]
            [--enable-s3-unverified-lookup]
            [--qos-policy-id QOS_POLICY_ID]
            [--share SHARE]
            [--s3-versioning]
            [--locking]
            [--default-retention-period DEFAULT_RETENTION_PERIOD]
            [--s3-locks-retention-mode NONE|GOVERNANCE|COMPLIANCE]
            [--allow-s3-anonymous-access]|[--block-s3-anonymous-access]
            [--enable-acls|--disable-acls]
            [--abe-protocols SMB]
            [--abe-max-depth LEVEL]
            [--files-retention-mode NONE|GOVERNANCE|COMPLIANCE]
            [--max-retention-period MAX_RETENTION_PERIOD]
            [--min-retention-period MIN_RETENTION_PERIOD]
            [--auto-commit AUTO_COMMIT]
            [--abac-tags TAGS]

Required Parameters

--path PATH

Specifies a path to a file system directory to be exposed to clients. It can be a directory that was already created by a client inside an exposed parent directory, or it can be a new directory, in which case you must specify the --create_dir option to create the directory.

Example:

--path /a/b/c

If you are going to use the path to create an S3 bucket, ensure that none of the subdirectories under the path has a replication protected path defined on it.

--policy-id ID

Specifies which view policy to apply. Specify ID as an integer value. To display view policy configurations with their IDs, use viewpolicy list. viewpolicy list

--protocols PROTOCOLS

Specifies which protocol(s) the view will be exposed to.

Specify PROTOCOLS as a string value for a single protocol or a comma separated list of strings to enable multiple protocols. Valid string values are:

  • NFS. To expose the view as an NFS export to clients using NFS version 3.

  • NFS4. To expose the view as an NFS export to clients using NFS version 4.1 or 4.2.

  • SMB  (Not in combination with ENDPOINT).  To expose the view as an SMB share to SMB clients.

    Note

    If you want to configure share-level ACL for an SMB-enabled view, see Managing Share-level ACLs via VAST CLI for the relevant commands to run after the view is created.

  • S3 (Not in combination with ENDPOINT). To expose the view as an S3 bucket.

  • ENDPOINT (Not in combination with SMB or S3). To create an S3 Endpoint, which is a template for creating buckets via S3 APIs. Whenever a bucket is created using this endpoint, a new view is created under the specified path. See Managing S3 Request-Initiated Bucket Creation for more information about S3 Endpoint buckets.

  • DATABASE. To expose the view as a VAST database. This option is used for each view that VAST Cluster creates when a user chooses to create a database on the cluster. For more information, see Configuring the VAST Cluster for Database Access.Configuring the VAST Cluster for Database Access

Examples:

--protocols NFS,SMB

--protocols NFS,NFS4,ENDPOINT

--protocols NFS,S3

--protocols SMB

--protocols DATABASE

Options

--tenant-id TENANT_ID

Specifies a non-default tenant to associate with the view.

--alias ALIAS

For NFSv3 exports, specifies an alternative shorter name for the path that can be used alternatively when mounting. Optional and relevant only if the view is exposed to NFS. An alias must begin with a forward slash ("/") and must consist of only ASCII characters.

An NFS export alias must be unique within the tenant.

--bucket BUCKETNAME

Specifies the name of an S3 bucket. Required if S3 is specified in --protocols.

A bucket name must be unique across all tenants of  the cluster. For more guidelines on bucket naming, see Overview of VAST Cluster S3 Implementation.Overview of VAST Cluster S3 Implementation

--bucket-owner BUCKET_OWNER

Specifies a user to be the bucket owner. Required if S3 is specified in --protocols.

--bucket-creators BUCKET_CREATORS

Relevant if ENDPOINT is specified in --protocols. Specifies users such that any request to create an S3 bucket that is sent by S3 API by a specified user will use this S3 Endpoint view.

Specify BUCKET_CREATORS as a comma separated list of user names.

Note

Users should not be specified as bucket creators in more than one S3 Endpoint view.

bucket-creators-groups BUCKET_CREATORS_GROUPS

Relevant if ENDPOINT is specified in --protocols. Specifies groups such that any request to create an S3 bucket that is sent by S3 API by a user who belongs to a specified group will use this S3 Endpoint view.

Specify BUCKET_CREATORS_GROUPS as a comma separated list of group names.

Caution

Take extra care not to duplicate bucket creators through groups: If you specify a group as a bucket creator group in one view and you also specify a user who belongs to that group as a bucket creator user in another view, view creation will not fail. Yet, there is a conflict between the two configurations and the selection of a view for configuring the user's buckets is not predictable.  

--create-dir

Creates a directory at the specified path. Include this option of the directory does not already exist.

--enable-global-sync

Supports seamless failover between replication peers by syncing file handles between the view and remote views on the replicated path on replication peers. This enables NFSv3 client users to retain the same mount point to the view in the event of a failover of the view path to a replication peer. Enabling this option may cause overhead and should only be enabled when the use case is relevant.  For more information about seamless replication, see Preparing for Seamless Replication Failover (NFSv3).

--enable-live-monitoring

Enables live monitoring on the view. Live monitoring can be enabled for up to ten views at one time and can also be enabled any time after view creation using view modify. view modify

Analytics data for views is polled every 5 minutes by default and every 10 seconds with live monitoring.

--qos-policy-id QOS_POLICY_ID

Associates a QoS policy with the view. Specify the QoS policy by its ID. To list QoS policy definitions, use qospolicy list.

--share SHARE

Specifies the SMB share name. Required if the view is exposed to SMB. The name cannot include the following characters: /\:|<>*?"

An SMB share name must be unique within the tenant.

--s3-versioning

Enables object versioning on the bucket if S3 is specified in --protocols.

--locking

Enables  object locking on the view bucket, if S3 is specified in --protocols, or file locking in NFSv3/SMB, if they are selected in --protocols. This setting can't be disabled after the view is created.

--s3-locks-retention-mode NONE|GOVERNANCE|COMPLIANCE

Sets a default retention mode for objects in the bucket.

Possible values:

  • NONE (default).  Object versions that are placed in the bucket have no automatic protection but can be configured with a retention period or legal hold.

  • GOVERNANCE. Object versions that are placed in the bucket are automatically protected with a retention lock with retention mode set to governance.  

  • COMPLIANCE. Object versions that are placed in the bucket are automatically protected with a retention lock with retention mode set to compliance.

--allow-anonymous-access

If the view has S3 Bucket or S3 Endpoint enabled, include this option to allow anonymous S3 access to the view's S3 bucket.

If allowed, anonymous requests are granted access provided that the object ACL grants access to the All Users group (in S3 Native security flavor) or the permission mode bits on the requested file and directory path grant access permission to "others" (in NFS security flavor). For views with SMB security flavor, anonymous requests are not granted access.

--block-anonymous-access

Blocks anonymous S3 access to the view's S3 bucket, if applicable. This is the default setting.

--enable-acls

When this option is specified, the user which uploads the object, becomes the object owner. Access is authorized based on ACLs and identity or bucket policies.

For more information about the ACLs enabled mode, see S3 Object Ownership.

--disable-acls

When this option is specified, the bucket owner has full control over any object in the bucket. Access to objects is controlled based on identity and bucket policies. ACLs are not used.

For more information about the ACLs disabled mode, see S3 Object Ownership.

--abe-protocols SMB

Enables Access-Based Enumeration (ABE) for the view, if  SMB is specified in --protocols.

By default, ABE is disabled.

--abe-max-depth LEVEL

Sets the maximum directory level (depth) at which ABE is enabled. By default, ABE depth is unlimited.

Specify LEVELS as an integer, for example: --abe-max-depth 3

--files-retention-mode NONE|GOVERNANCE|COMPLIANCE

Sets the retention mode for files saved in the view, if locking (--locking ) is enabled.

Possible values:

  • NONE (default).  Files that are saved to the view have no automatic protection but can be manually configured with a retention period or legal hold.

  • GOVERNANCE. Files that are saved in the view are automatically protected with a retention lock with retention mode set to governance.  In this mode, the retention period can be lengthened or shortened.

  • COMPLIANCE. Files that are saved in the view are automatically protected with a retention lock with retention mode set to compliance. In this mode, the retention period can be lengthened, but not shortened.

--default-retention-period DEFAULT_RETENTION

Sets the default retention period for files that are locked in the view to DEFAULT_RETENTION. Files that are locked automatically using auto-commit will be locked for this period of time, after which they will be unlocked.

Files that are locked manually (by setting the atime for the file to a future time) do not use the default retention period.

The value DEFAULT_RETENTION must be in the range between the min-retention-period and max-retention-period.

Set it as an integer value, including units (m - minutes, h - hours, d - days, y - years).

Example: 5d (5 days).

--max-retention-period MAX_RETENTION

Sets the maximum retention period for files that are locked in the view to MAX_RETENTION. Files cannot be locked for longer than this period, whether  they are locked manually (by setting the atime) or automatically, using  auto-commit.

It must be larger than the min-retention-period.

Set it as an integer value, including units (m - minutes, h - hours, d - days, y - years).

Example:  2m (2 months).

--min-retention-period MIN_RETENTION

Sets the minimum retention period for files that are locked in the view to MIN_RETENTION. Files cannot be locked for less than this period, whether locked manually (by setting the atime) or automatically, using  auto-commit.

It must be less than the max-retention-period.

Set it as an integer value, including units (m - minutes, h - hours, d - days, y - years).

Example: 3d (3 days).

--auto-commit AUTO_COMMIT

Sets the auto-commit time to AUTO_COMMIT for files that are locked automatically. These files are locked automatically after the AUTO_COMMIT period elapses from the time the file is saved. Files locked automatically are locked for the default-retention-period, after which they are unlocked.

If set, then --default-retention-period, --min-retention-period, and --max-retention-period must also be set.

Set it as an integer value, including units (m - minutes, h - hours, d - days, y - years).

Example: 5m (5 minutes).

--abac-tags TAGS

If you are going to use Attribute-Based Access Control (ABAC), enter a comma-separated list of ABAC tags.

Up to 20 ABAC tags can be defined per view. ABAC tags are case-sensitive and can include alphanumeric characters, a hyphen (-), a colon (:), a plus sign (+), and an underline (_).

For example: red,green,yellow

Example

This example creates a view of the pre-existing /dev directory, with an NFS export, using the default view policy.

vcli: admin> view create --path /dev --protocols NFS

This example creates a multiprotocol view of a directory at the /home/users/devteam path using a non default view policy.

vcli: admin> view create --path  /home/users/devteam --protocols NFS,SMB --alias /devteam --share devteamusers  --policy-id 2 --create-dir