Module netapp_ontap.resources.svm

Copyright © 2019 NetApp Inc. All rights reserved.

Managing SVMs


Cluster administrators can manage any SVM bound to the cluster. In addition, SVMs can also be managed by their SVM administrators. The SVM administrator manages the SVM resources, such as volumes, protocols and services, depending on the capabilities assigned by the cluster administrator. SVM administrators cannot create, modify, or delete SVMs. The cluster administrator manages SVM create, modify, or delete operations.

While configuring CIFS, you must also configure IP interfaces and DNS. No other protocol configuration is allowed when configuring NVMe. NFS, FCP, CIFS and iSCSI protocols can be configured together.
SVM administrators might have all or some of the following administration capabilities: 1. Data access protocol configuration Configures data access protocols, such as NFS, CIFS, iSCSI, and Fibre Channel (FC) protocol (Fibre Channel over Ethernet included). 2. Services configuration Configures services such as LDAP, NIS, and DNS. 3. Monitoring SVM Monitors jobs, network connections, network interfaces, and SVM health.

Classes

class Svm (*args, **kwargs)

Allows interaction with Svm objects on the host

Initialize the instance of the resource.

Any keyword arguments are set on the instance as properties. For example, if the class was named 'MyResource', then this statement would be true:

MyResource(name='foo').name == 'foo'

Args

*args
Each positional argument represents a parent key as used in the URL of the object. That is, each value will be used to fill in a segment of the URL which refers to some parent object. The order of these arguments must match the order they are specified in the URL, from left to right.
**kwargs
each entry will have its key set as an attribute name on the instance and its value will be the value of that attribute.

Ancestors

Static methods

def delete_collection(*args, connection: HostConnection = None, **kwargs) -> NetAppResponse

Deletes an SVM. As a prerequisite, SVM objects must be deleted first. SnapMirror relations must be deleted and data volumes must be offline and deleted. The number of parallel SVMs that can be deleted should not be greater than 5. When the sixth SVM DELETE request is issued, the error message "Maximum allowed SVM jobs exceeded. Wait for the existing SVM jobs to complete and try again." will be returned.

  • vserver delete

Example

Deletes an individual SVM in the cluster.
DELETE "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485"

Learn more


Delete all objects in a collection which match the given query.

All records on the host which match the query will be deleted.

Args

*args
Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to delete the collection of bars for a particular foo, the foo.name value should be passed.
connection
The HostConnection object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
**kwargs
Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.

Returns

A NetAppResponse object containing the details of the HTTP response.

Raises

NetAppRestError: If the API call returned a status code >= 400

def find(*args, connection: HostConnection = None, **kwargs) -> Resource

Retrieves a list of SVMs and individual SVM properties. This includes protocol configurations such as CIFS and NFS, export policies, name service configurations, and network services.

Important notes

  • The SVM object includes a large set of fields and can be expensive to retrieve. Use this API to list the collection of SVMs, and to retrieve only the full details of individual SVMs as needed.
  • It is not recommended to create or delete more than five SVMs in parallel.
  • REST APIs only expose a data SVM as an SVM.
  • vserver show

Examples

  1. Retrieves a list of SVMs in the cluster sorted by name
    GET "/api/svm/svms?order_by=name"
  2. Retrieves a list of SVMs in the cluster that have the NFS protocol enabled
    GET "/api/svm/svms?nfs.enabled=true"
  3. Retrieves a list of SVMs in the cluster that have the CIFS protocol enabled
    GET "/api/svm/svms?cifs.enabled=true"

Learn more


Find an instance of an object on the host given a query.

The host will be queried with the provided key/value pairs to find a matching resource. If 0 are found or if more than 1 is found, an error will be raised or returned. If there is exactly 1 matching record, then it will be returned.

Args

*args
Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to find a bar for a particular foo, the foo.name value should be passed.
connection
The HostConnection object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
**kwargs
Any key/value pairs passed will be sent as query parameters to the host.

Returns

A Resource object containing the details of the object.

Raises

NetAppRestError: If the API call did not return exactly 1 matching resource.

def get_collection(*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> typing.Iterable

Retrieves a list of SVMs and individual SVM properties. This includes protocol configurations such as CIFS and NFS, export policies, name service configurations, and network services.

Important notes

  • The SVM object includes a large set of fields and can be expensive to retrieve. Use this API to list the collection of SVMs, and to retrieve only the full details of individual SVMs as needed.
  • It is not recommended to create or delete more than five SVMs in parallel.
  • REST APIs only expose a data SVM as an SVM.
  • vserver show

Examples

  1. Retrieves a list of SVMs in the cluster sorted by name
    GET "/api/svm/svms?order_by=name"
  2. Retrieves a list of SVMs in the cluster that have the NFS protocol enabled
    GET "/api/svm/svms?nfs.enabled=true"
  3. Retrieves a list of SVMs in the cluster that have the CIFS protocol enabled
    GET "/api/svm/svms?cifs.enabled=true"

Learn more


Fetch a list of all objects of this type from the host.

Args

*args
Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the collection of bars for a particular foo, the foo.name value should be passed.
connection
The HostConnection object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
max_records
The maximum number of records to return per call
**kwargs
Any key/value pairs passed will be sent as query parameters to the host.

Returns

A list of Resource objects

Raises

NetAppRestError: If there is no connection available to use either passed in or on the library.

def patch_collection(body: dict, *args, connection: HostConnection = None, **kwargs) -> NetAppResponse

Updates one or more of the following properties of an individual SVM: SVM name, SVM default volume language code, SVM comment, and SVM state.

  • vserver modify
  • vserver rename
  • vserver start
  • vserver stop

Examples

  1. Stops an SVM and updates the "comment" field for an individual SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"state":"stopped", "comment":"This SVM is stopped."}'
  2. Starts an SVM and updates the "comment" field for an individual SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"state":"running", "comment":"This SVM is running."}'
  3. Updates the "language" field for an individual SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"language":"en.UTF-8"}'
  4. Updates the "name" field for an SVM or renames the SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"name":"svm_new"}'
  5. Updates the aggregates for an individual SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"aggregates":{"name":["aggr1","aggr2","aggr3"]}}'
  6. Updates the Snapshot copy policy for an individual SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"snapshot_policy":{"name":"custom1"}}'

Learn more


Patch all objects in a collection which match the given query.

All records on the host which match the query will be patched with the provided body.

Args

body
A dictionary of name/value pairs to set on all matching members of the collection.
*args
Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to patch the collection of bars for a particular foo, the foo.name value should be passed.
connection
The HostConnection object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
**kwargs
Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.

Returns

A NetAppResponse object containing the details of the HTTP response.

Raises

NetAppRestError: If the API call returned a status code >= 400

Methods

def delete(self, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse

Deletes an SVM. As a prerequisite, SVM objects must be deleted first. SnapMirror relations must be deleted and data volumes must be offline and deleted. The number of parallel SVMs that can be deleted should not be greater than 5. When the sixth SVM DELETE request is issued, the error message "Maximum allowed SVM jobs exceeded. Wait for the existing SVM jobs to complete and try again." will be returned.

  • vserver delete

Example

Deletes an individual SVM in the cluster.
DELETE "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485"

Learn more


Send a deletion request to the host for this object.

Args

poll
If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
Any key/value pairs passed will be sent as query parameters to the host.

Returns

A NetAppResponse object containing the details of the HTTP response.

Raises

NetAppRestError: If the API call returned a status code >= 400

def get(self, **kwargs) -> NetAppResponse

Retrieves the properties for an individual SVM. This includes protocol configurations such as CIFS and NFS, export policies, name service configurations, and network services.

Important note

  • The SVM object includes a large set of fields and can be expensive to retrieve.
  • REST APIs only expose a data SVM as an SVM.

Example

Retrieves an individual SVM in the cluster
<br/>
```
GET "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485"
```
<br/>

Learn more


Fetch the details of the object from the host.

Requires the keys to be set (if any). After returning, new or changed properties from the host will be set on the instance.

Returns

A NetAppResponse object containing the details of the HTTP response.

Raises

NetAppRestError: If the API call returned a status code >= 400

def patch(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse

Updates one or more of the following properties of an individual SVM: SVM name, SVM default volume language code, SVM comment, and SVM state.

  • vserver modify
  • vserver rename
  • vserver start
  • vserver stop

Examples

  1. Stops an SVM and updates the "comment" field for an individual SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"state":"stopped", "comment":"This SVM is stopped."}'
  2. Starts an SVM and updates the "comment" field for an individual SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"state":"running", "comment":"This SVM is running."}'
  3. Updates the "language" field for an individual SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"language":"en.UTF-8"}'
  4. Updates the "name" field for an SVM or renames the SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"name":"svm_new"}'
  5. Updates the aggregates for an individual SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"aggregates":{"name":["aggr1","aggr2","aggr3"]}}'
  6. Updates the Snapshot copy policy for an individual SVM
    PATCH "/api/svm/svms/f16f0935-5281-11e8-b94d-005056b46485" '{"snapshot_policy":{"name":"custom1"}}'

Learn more


Send the difference in the object's state to the host as a modification request.

Calculates the difference in the object's state since the last time we interacted with the host and sends this in the request body.

Args

hydrate
If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
poll
If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
Any key/value pairs passed will be sent as query parameters to the host.

Returns

A NetAppResponse object containing the details of the HTTP response.

Raises

NetAppRestError: If the API call returned a status code >= 400

def post(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse

Creates and provisions an SVM. If no IPspace is provided, then the SVM is created on the Default IPspace. The number of parallel SVMs that can be created should not be greater than 5. When the sixth SVM POST request is issued, the error message "Maximum allowed SVM jobs exceeded. Wait for the existing SVM jobs to complete and try again." will be returned.

Required properties

  • name - Name of the SVM to be created.
  • ipspace.name or ipspace.uuid - IPspace of the SVM
  • ip_interfaces - If provided, the following fields are required:
  • ip_interfaces.name - Name of the interface
  • ip_interfaces.ip.address - IP address
  • ip_interfaces.ip.netmask - Netmask length or IP address
  • ip_interfaces.location.broadcast_domain.uuid or ip_interfaces.location.broadcast_domain.name - Broadcast domain name or UUID belonging to the same IPspace of the SVM.
  • routes - If provided, the following field is required:
  • routes.gateway - Gateway IP address
  • cifs - If provided, interfaces, routes and DNS must be provided. The following fields are also required:
  • cifs.name - Name of the CIFS server to be created for the SVM.
  • cifs.ad_domain.fqdn - Fully qualified domain name
  • cifs.ad_domain.user - Administrator username
  • cifs.ad_domain.password - User password
  • ldap - If provided, the following fields are required:
  • ldap.servers or ldap.ad_domain - LDAP server list or Active directory domain
  • ldap.bind_dn - Bind DN
  • ldap.base_dn - Base DN
  • nis - If provided, the following fields are required:
  • nis.servers - NIS servers
  • nis.domain - NIS domain
  • dns - If provided, the following fields are required:
  • dns.servers - Name servers
  • dns.domains - Domains

Default property values

If not specified in POST, the following default property values are assigned: * language - C.UTF-8 * ipspace.name - Default * snapshot_policy.name - Default * subtype - Default ( sync-source if MetroCluster configuration )

  • vserver create
  • vserver add-aggregates
  • network interface create
  • network route create
  • vserver services name-service dns create
  • vserver nfs create
  • vserver services name-service ldap client create
  • vserver cifs create
  • vserver services name-service nis-domain create
  • vserver iscsi create
  • vserver nvme create
  • vserver fcp create
  • vserver services name-service ns-switch create

Examples

  1. Creates an SVM with default "snapshot_policy"
    POST "/api/svm/svms" '{"name":"testVs", "snapshot_policy":{"name":"default"}}'
  2. Creates an SVM and configures NFS, ISCSI and FCP
    POST "/api/svm/svms" '{"name":"testVs", "nfs":{"enabled":"true"}, "fcp":{"enabled":"true"}, "iscsi":{"enabled":"true"}}'
  3. Creates an SVM and configures NVMe
    POST "/api/svm/svms" '{"name":"testVs", "nvme":{"enabled":"true"}}'
  4. Creates an SVM and configures LDAP
    POST "/api/svm/svms" '{"name":"testVs", "snapshot_policy":{"name":"default"}, "ldap":{"servers":["10.140.101.1","10.140.101.2"], "ad_domain":"abc.com", "base_dn":"dc=netapp,dc=com", "bind_dn":"dc=netapp,dc=com"}}'
  5. Creates an SVM and configures NIS
    POST "/api/svm/svms" '{"name":"testVs", "snapshot_policy":{"name":"default"}, "nis":{"enabled":"true", "domain":"def.com","servers":["10.224.223.130", "10.224.223.131"]}}'
  6. Creates an SVM and configures DNS
    POST "/api/svm/svms" '{"name":"testVs", "snapshot_policy":{"name":"default"}, "dns":{"domains":["abc.com","def.com"], "servers":["10.224.223.130", "10.224.223.131"]}}'
  7. Creates an SVM and configures a LIF
    POST "/api/svm/svms" '{"name":"testVs", "ip_interfaces": [{"name":"lif1", "ip":{"address":"10.10.10.7", "netmask": "255.255.255.0"}, "location":{"broadcast_domain":{"name":"bd1"}, "home_node":{"name":"node1"}}, "service_policy": "default-management"}]}'
  8. Creates an SVM and configures a LIF with IPV6 address
    POST "/api/svm/svms" '{"name":"testVs", "ip_interfaces": [{"name":"lif2", "ip":{"address":"fd22:8b1e:b255:202:2a0:98ff:fe01:7d5b", "netmask":"24"}, "location":{"broadcast_domain":{"name":"bd1"}, "home_node":{"name":"node1"}}, "service_policy": "default-management"}]}'
  9. Creates an SVM and configures CIFS
    POST "/api/svm/svms" '{"name":"testVs", "cifs":{"name":"CIFDOC", "ad_domain":{"fqdn":"abc.def.com", "organizational_unit":"CN=Computers", "user":"cif_admin", "password":"abc123"}}, "ip_interfaces":[{"name":"lif1", "ip":{"address":"10.10.10.7", "netmask": "255.255.255.0"}, "location":{"broadcast_domain":{"name":"bd1"}, "home_node":{"name":"node1"}}, "service_policy": "default-management"}],"routes": [{"destination": {"address": "0.0.0.0", "netmask": "0"}, "gateway": "10.10.10.7"}], "dns":{"domains":["abc.def.com", "def.com"], "servers":["10.224.223.130", "10.224.223.131"]}}'

Learn more


Send this object to the host as a creation request.

Args

hydrate
If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
poll
If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
Any key/value pairs passed will be sent as query parameters to the host.

Returns

A NetAppResponse object containing the details of the HTTP response.

Raises

NetAppRestError: If the API call returned a status code >= 400

Inherited members

class SvmSchema (only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

The fields of the Svm object

Ancestors

  • netapp_ontap.resource.ResourceSchema
  • marshmallow.schema.Schema
  • marshmallow.schema.BaseSchema
  • marshmallow.base.SchemaABC

Class variables

var aggregates

List of allowed aggregates for SVM volumes. An administrator is allowed to create volumes on these aggregates.

var cifs

The cifs field of the svm.

var comment

Comment

var dns

The dns field of the svm.

var fcp

The fcp field of the svm.

var ip_interfaces

IP interfaces for the SVM

var ipspace

The ipspace field of the svm.

var iscsi

The iscsi field of the svm.

var language

Default volume language code. UTF-8 encoded languages are valid in POST or PATCH. Non UTF-8 language encodings are for backward compatibility and are not valid input for POST and PATCH requests.

Valid choices:

  • c
  • da
  • de
  • en
  • en_us
  • es
  • fi
  • fr
  • he
  • it
  • ja
  • ja_jp.pck
  • ko
  • nl
  • pt
  • sv
  • zh
  • zh.gbk
  • zh_tw
  • zh_tw.big5
  • c.utf_8
  • ar
  • ar.utf_8
  • cs
  • cs.utf_8
  • da.utf_8
  • de.utf_8
  • en.utf_8
  • en_us.utf_8
  • es.utf_8
  • fi.utf_8
  • fr.utf_8
  • he.utf_8
  • hr
  • hr.utf_8
  • hu
  • hu.utf_8
  • it.utf_8
  • ja.utf_8
  • ja_v1
  • ja_v1.utf_8
  • ja_jp.pck.utf_8
  • ja_jp.932
  • ja_jp.932.utf_8
  • ja_jp.pck_v2
  • ja_jp.pck_v2.utf_8
  • ko.utf_8
  • no.utf_8
  • nl.utf_8
  • pl
  • pl.utf_8
  • pt.utf_8
  • ro
  • ro.utf_8
  • ru
  • ru.utf_8
  • sk
  • sk.utf_8
  • sl
  • sl.utf_8
  • sv.utf_8
  • tr
  • tr.utf_8
  • zh.utf_8
  • zh.gbk.utf_8
  • zh_tw.utf_8
  • zh_tw.big5.utf_8
  • utf8mb4
var ldap

The ldap field of the svm.

The links field of the svm.

var name

The name of the SVM.

Example: svm1

var nfs

The nfs field of the svm.

var nis

The nis field of the svm.

var nsswitch

The nsswitch field of the svm.

var nvme

The nvme field of the svm.

var opts
var routes

Optional array of routes for the SVM

var snapshot_policy

The snapshot_policy field of the svm.

var state

SVM State

Valid choices:

  • starting
  • running
  • stopping
  • stopped
  • deleting
var subtype

SVM subtype. The SVM subtype sync_destination is created automatically when an SVM of subtype sync_source is created on the source MetroCluster cluster. A POST request with sync_destination as SVM subtype is invalid.

Valid choices:

  • default
  • dp_destination
  • sync_source
  • sync_destination
var uuid

The unique identifier of the SVM.

Example: 02c9e252-41be-11e9-81d5-00a0986138f7