Storage Appliance API

Copyright (C) Nexenta Systems, Inc. All rights reserved.


1  API Overview
2  Block Diagram
3  Terms and Conventions
4  Object Model
5  Data Types
  5.1  Receiving an Array
  5.2  Receiving a Dictionary
  5.3  Passing an Array
  5.4  Passing a Dictionary
6  Virtual Base Object
  6.1  get_prop - Get property value
  6.2  get_props - Get { propname => value } dictionary of all properties ...
  6.3  set_prop - Set property value
7  Virtual Container
  7.1  destroy - Destroy child object specified by its name
  7.2  get_child_prop - For a given (contained) child, get the specified property ...
  7.3  get_child_props - For a given (contained) child get { propname => value ...
  7.4  get_names - Get array of all (contained) children names matching the specified ...
  7.5  get_names_by_prop - Get array of all (container) children which has matching property ...
  7.6  object_exists - Verify that object exists
  7.7  set_child_prop - For a given (contained) child update the specified property with ...
  7.8  trylock - Make an attempt to lock the specified child
  7.9  unlock - Unlock the specified child
8  General Appliance Management
  8.1  add_swap - Add zvol as an additional swap area
  8.2  dbus_auth_iptable_is_set - Determine whether the specified deny or allow access rule is ...
  8.3  dbus_auth_iptable_list - Get all iptable access rules. Background: The appliance provides secure ...
  8.4  dbus_auth_iptable_set - Deny or allow access to the appliance from the specified ...
  8.5  dbus_auth_iptable_unset - Remove deny or allow access rule from the appliance's iptable. ...
  8.6  dbus_auth_keys_add - Add new key to the client key authorization table. Background: ...
  8.7  dbus_auth_keys_list - Get all authorization keys and their IDs. Background: The appliance ...
  8.8  dbus_auth_keys_remove - Remove authentication key.
  8.9  delete_swap - Remove zvol swap area - undo the effect of com.nexenta.nms.Appliance::add_swap ...
  8.10  get_cpu_info - Get detailed per-CPU information
  8.11  get_etchosts_rec - Given a hostname or a part of a hostname, or ...
  8.12  get_fqdn - Get a fully qualified domain name (FQDN) of the appliance. ...
  8.13  get_kbd_layouts - Get all supported keyboard layouts
  8.14  get_license_info - Get license information
  8.15  get_memstat - Get RAM utilization information
  8.16  get_saved_configurations - Get the list of all available saved configurations.
  8.17  get_subtimezones - Get time zones for the specified country located in the ...
  8.18  get_timezone_continent - Get time zone code for the specified country
  8.19  get_timezone_continents - Get all time zone continents
  8.20  get_timezone_country_code - Get time zone code for the specified country
  8.21  get_timezones - Given a time zone continent, get all its time zones ...
  8.22  get_uptime - Get appliance's uptime, including the following information: The current time, ...
  8.23  list_appliances - Get all SSH-bound as well as dynamically discovered on a ...
  8.24  list_swap - Get summary information about total swap space usage, existing swap ...
  8.25  ns_getent - Get local and LDAP based users, groups, and netgroups ...
  8.26  ns_group_del - Delete the specified group
  8.27  ns_group_exists - Find out whether a given group exists; if found, the ...
  8.28  ns_group_get - Given a local or LDAP defined group, get properties such ...
  8.29  ns_group_idmap_get - Get identity mapping for a given Unix group.
  8.30  ns_group_set - Modify existing local group or create a new group, if ...
  8.31  ns_netgroup - Get a list of hosts (computers) included in a given ...
  8.32  ns_user_del - Delete the specified user
  8.33  ns_user_exists - Find out whether a given user exists; if found, the ...
  8.34  ns_user_get - Given a local or LDAP defined user, get properties such ...
  8.35  ns_user_idmap_get - Get identity mapping for a given Unix user.
  8.36  ns_user_set - Modify existing local user or add new local user, if ...
  8.37  poweroff - Power off the appliance
  8.38  reboot - Reboot the appliance
  8.39  restore_configuration - Restore appliance's configuration from the most recent copy stored at ...
  8.40  save_configuration - Save appliance's configuration at a pre-defined location. The current location ...
  8.41  set_etchosts_rec - Add, replace or delete a record from the appliance's local ...
  8.42  set_license_key - Update license key
  8.43  ssh_bind - SSH-bind a given (user, appliance) to the specified remote host. ...
  8.44  ssh_check_binding - Check whether the specified appliance's user is SSH-bound to the ...
  8.45  ssh_list_bindings - Get all existing SSH bound hosts
  8.46  ssh_unbind - SSH-unbind a given (user, appliance) from the specified remote host. ...
  8.47  ssl_bind - Add a new certificate to LDAP managed database
  8.48  ssl_check_binding - Check whether the specified certificate exists in database
  8.49  ssl_direct_bind - Add a new certificate to LDAP managed database
  8.50  ssl_list_bindings - Get trusted host information for all existing certificates
  8.51  ssl_list_certificates - Get certificate files
  8.52  ssl_list_certinfos - Get certificate information for all existing certificates
  8.53  ssl_unbind - Remove the specified certificate from database - compare with com.nexenta.nms.Appliance::ssl_unbind_by_hostname ...
  8.54  ssl_unbind_by_hostname - Remove certificate from the LDAP managed database
  8.55  upgrade_check - Check for appliance software upgrades
9  Groups of Appliances Management
  9.1  create - Create a new group of two or more appliances. To ...
  9.2  destroy - Destroy the specified group of appliances. This is an opposite ...
  9.3  get_group_types - Returns array of supported group types, for instance ['basic'] ...
  9.4  get_members - For a given group, get its member appliances
10  Virtual Runner
  10.1  disable - Disable the specified runner, ie stop (suspend) its execution. The ...
  10.2  enable - Enable the specified runner. The runner must be registered (see ...
  10.3  execute - Execute the specified runner. The operation allows to run the ...
  10.4  get_tunables - Get the runner's tunables and their descriptions. For defintion of ...
  10.5  is_registered - Check whether the specified runner is registered with the appliance. ...
  10.6  register - Register the specified runner. The operation validates runner's parameters and ...
  10.7  set_tunable - Modify the runner's (tunable) property value. A given runner may ...
  10.8  unregister - Unregister the specified runner. The operation reverses the effect of ...
11  Fault Management
  11.1  clear - Clear specific fault ID
  11.2  clear_all - Clear all faults generated by the specified fault trigger ...
  11.3  fault - Generate fault notification
  11.4  get_faults - Get faults generated so far by the specified fault trigger; ...
12  Statistics Collection
13  Reporting Facility (Services, Performance, Capacity)
14  Folder and Snapshot Indexing Facility (Search Engine)
  14.1  create - Create indexer for the specified folder. Once created, the indexer ...
  14.2  destroy - Destroy the specified indexer
  14.3  search - Search the folder and its snapshot(s).
15  Logical and Physical Disk Management
  15.1  cache - Retrieve, enable and disable on-disk read and write cache. The ...
  15.2  disk_is_avail - Determine whether the specified disk (LUN) is available for usage, ...
  15.3  lunsync - Resynchronize appliance's LUNs. Re-enumerates devices in the appliance. This interface ...
  15.4  mounted_disks - Get all mounted disks. The disk is considered mounted if ...
16  Volume (Pool)
  16.1  attach_lun - Attach to an existing mirror if the mirror containing ...
  16.2  clear_lun - Clear device errors in a volume. Device errors are periodically ...
  16.3  destroy - Destroy the specified volume and free up devices it uses. ...
  16.4  detach_lun - Detach device from a mirror
  16.5  get_import_volumes - Get information on all or selected volumes that can be ...
  16.6  get_luns - Get LUNs of a given volume
  16.7  get_luns_for_all_volumes - Get all LUNs contained (or used) by the appliance's volumes ...
  16.8  get_names - Get volume names matching a specified pattern
  16.9  get_prop_valid_values - Get valid range and/or enumeration for a given volume's property. ...
  16.10  get_status - Get volume's status
  16.11  get_version_info - Get volume's ZFS version
  16.12  history - Get volume history records, in terms of executed ZFS commands ...
  16.13  offline_lun - Take the specified physical device offline. While the device is ...
  16.14  online_lun - Bring the specified physical device online. This operation is not ...
  16.15  remove_lun - Permanently remove a given device from the volume. This method ...
  16.16  replace_lun - Replace device in a mirror. The operation replaces with ...
  16.17  resolve_lun_to_volumes - Resolves LUN to its container volume(s).
  16.18  upgrade - Upgrade volume's ZFS version. WARNING: special consideration need to be ...
  16.19  vol_create - Create a volume
  16.20  vol_export - Export the specified volume. This will also cleanup/destroy: (1) all ...
  16.21  vol_grow - Grow a volume
  16.22  vol_import - Import a volume
17  Zvol (Emulated Volume-based Block Device)
  17.1  clone - Clone a given zvol. The operation results in a writable ...
  17.2  create - Create new zvol. Background: the appliance provides an easy iSCSI ...
  17.3  create_snapshot - Snapshot a given zvol
  17.4  create_with_props - Create a new zvol. This API allows to specify creation ...
  17.5  destroy - Destroy existing zvol
  17.6  get_names - Get zvol names matching a specified pattern.
  17.7  get_prop_valid_values - Get valid range and/or enumeration for a given zvol's property. ...
  17.8  set_child_prop - Set property value
18  Folder (Filesystem)
  18.1  add_group_acl - Add the group's permissions to access a given folder and ...
  18.2  add_user_acl - Add the user's permissions to access a given folder and ...
  18.3  clone - Creates a clone of a given snapshot. The operation results ...
  18.4  create - Create a "path" of folders
  18.5  create_snapshot - Snapshot a given folder and possibly its sub-folders
  18.6  create_with_props - Create a "path" of folders. This API allows to specify ...
  18.7  del_group_acl - Remove the group's permissions from the folder's ACL
  18.8  del_user_acl - Remove the user's permissions from the folder's ACL
  18.9  destroy - Destroy a given folder, its sub-folders and snapshots. The operation ...
  18.10  get_acl - Get folder's ACL for the entities matching the specified pattern ...
  18.11  get_acl_by_index - Retrieve complete folder's ACL, and possibly check for duplicate entries. ...
  18.12  get_aclinfo - Get ACL related static information: groups of permissions and descriptions ...
  18.13  get_names - Get folder names matching a specified pattern
  18.14  get_prop_valid_values - Get valid range and/or enumeration for a given folder's property. ...
  18.15  get_subfolder_names - Get sub-folder names
  18.16  get_version_info - Get folder's ZFS version
  18.17  inherit_prop - Restore system-default inheritance of a given ZFS property. The method ...
  18.18  reset_acl - Reset the folder's ACLs to the system default (POSIX, built-in) ...
  18.19  set_child_prop - Set folder's property value
  18.20  set_group_acl - Set the group's permissions to access a given folder and ...
  18.21  set_group_owner - Change the group ownership of a given folder
  18.22  set_user_acl - Set the user's permissions to access a given folder and ...
  18.23  set_user_owner - Change the user ownership of a given folder
  18.24  upgrade - Upgrade folder's ZFS version
19  Snapshot Management
  19.1  create - Create (ie, take) snapshots, recursively or non-recursively, depending on the ...
  19.2  destroy - Destroy the specified snapshot
  19.3  get_names - Get snapshot names matching a specified pattern
  19.4  get_snapshot_names - Get existing snapshots of the specified folder and possibly its ...
  19.5  rollback - Rollback a folder to a given snapshot
20  Service Management Facility (SMF)
  20.1  destroy - Destroy the specified service instance. Note: for the list of ...
  20.2  disable - Disable the specified SMF service
  20.3  enable - Enable the specified SMF service. Clears the maintenance state, if ...
  20.4  get_logfile - Get the service's logfile name
  20.5  get_state - Get the current state of the specified service
  20.6  reread_config - Re-read and re-apply services configuration. The operation effectively updates the ...
  20.7  restart - Restart the specified SMF service. The operation is equivalent to ...
  20.8  set_child_prop - Update the specified service's property with a new value. This ...
21  Virtual Automatic Storage Service
  21.1  execute - Execute the specified storage (auto-) service instance. This SA-API method ...
  21.2  get_sock_stats - Get just-in-time transport statistics. The method can be used to ...
  21.3  is_running - Find out whether the service is currently running
  21.4  is_scheduled - Find out whether the service is scheduled
  21.5  seconds_until_next_run - For a given auto-service, returns the number of seconds remaining ...
22  AutoScrub (volume scrubbing) Service
23  AutoSnap (snapshot) Service
24  AutoSync (data replication) Service
  24.1  reset - Clear auto-sync service object's markers and try to recover the ...
  24.2  reverse_direction - Reverse the direction of a given auto-sync replication. Background: the ...
25  AutoTier (data replication) Service
26  Network Services Management
27  System Upgrade, Rollback and Checkpoint Management
  27.1  activate_rootfs - Activate, that is make default, the specified system checkpoint. This ...
  27.2  destroy_rootfs - Destroy the specified system checkpoint. Note that the appliance will ...
  27.3  get_rootfs_names - Get the names of all existing root filesystems a.k.a system ...
  27.4  get_rootfs_prop - Get the specified property of the system checkpoint
  27.5  get_rootfs_props - Get properties of the specified system checkpoint
  27.6  get_upgrade_info - Get detailed appliance software upgrade status
28  Network Storage Service
  28.1  get_share_confopts - Get static configuration options associated with the specified storage access ...
  28.2  get_shared_folders - Get all folders shared via the specified storage access protocol ...
  28.3  get_shareopts - Get configuration options associated with the specified share
  28.4  is_folder_shared - Find out whether the specified folder is shared via the ...
  28.5  share_folder - Share the specified folder via the specified storage access protocol ...
  28.6  unshare_all - Unshare the specified folder globally, as far as all or ...
  28.7  unshare_folder - Unshare the specified folder from access via the specified storage ...
29  Nexenta Management Server
  29.1  get_extended_lock_info - Get extended lock information.
  29.2  get_locks - Get all existing NMS locks.
  29.3  get_prop - Get NMS property.
  29.4  get_reply_timeout - Get Nexenta Management Server D-Bus reply timeout.
  29.5  list_props - Get all NMS properties (name, value pairs) and their descriptions. ...
  29.6  nmdtrace_status - Get Restart Nexenta DTrace statistic service status.
  29.7  register_local_client - Register local NMS client - an external local process that ...
  29.8  reread_config - Re-read server configuration.
  29.9  restart_nmcd - Restart Nexenta Management Console daemon.
  29.10  restart_nmdtrace - Restart Nexenta DTrace statistic service daemon. Nexenta DTrace Service is ...
  29.11  set_prop - Set NMS property.
  29.12  set_reply_timeout - Set Nexenta Management Server D-Bus reply timeout.
  29.13  unregister_local_client - Unregister local NMS client.
30  Network Management
  30.1  add_route - Add a route to a given destination via the specified ...
  30.2  delete_route - Delete a route, given destination and gateway.
  30.3  find_gateway_hostname - Given remote IP address, find the corresponding gateway.
  30.4  gateway - Get appliance's default gateway.
  30.5  get_nmv_url - Get Nexenta Management View URL for the appliance.
  30.6  get_routes - Get all routes.
  30.7  nameservers - Get name servers.
  30.8  primary - Get primary network interface.
  30.9  set_gateway - Set appliance's default gateway.
  30.10  set_nameservers - Set name servers. Appliance may have up to 3 configured ...
  30.11  set_nmv_proto - Set Nexenta Management View protocol. The valid values are: 'HTTP' ...
  30.12  set_primary - Set primary network interface.
31  Network Interfaces Management
  31.1  create_aggr - Create an 802.3ad aggregated network interface (link).
  31.2  create_ipalias - Create IP alias (aka "logical IP interface").
  31.3  create_vlan - Create VLAN interface.
  31.4  destroy_aggr - Destroy the specified aggregated link. This operation reverses the effect ...
  31.5  destroy_ipalias - Destroy the specified IP alias (aka "logical IP interface"). ...
  31.6  destroy_vlan - Destroy the specified VLAN interface.
  31.7  get_max_mtu - Get maximum MTU size supported by a given network interface ...
  31.8  get_min_mtu - Get minimum MTU size supported by a given network interface ...
  31.9  get_other_drv_ifaces - Helper method that returns an array of all network interfaces ...
  31.10  is_capable - Helper method that determines whether a given network interface driver ...
  31.11  is_drv_locked - Helper method that evaluates the following condition: one or more ...
  31.12  is_drv_reload_required - Helper method that determines whether the network interface driver must ...
  31.13  set_dhcp - Configure the specified network interface via DHCP. Note that unlike ...
  31.14  set_macaddr - Set MAC address of given network interface.
  31.15  set_static - Statically configure the specified network interface. Compare with com.nexenta.nms.NetworkInterface::set_dhcp. ...
  31.16  set_unconfigure - Unconfigure the spesified network interface. This operation reverses the effect ...
32  iSCSI Initiator
  32.1  get_all_luns - Get all iSCSI attached LUNs (disks).
  32.2  get_connections - Get all connections for the given iSCSI session between the ...
  32.3  get_defaults - Get the configured Initiator parameters. The list includes: InitiatorName, InitiatorAlias, ...
  32.4  get_discovery - List (TargetName, TargetAddress, TPGT) triplets for all configured discoveries. ...
  32.5  get_discovery_state - Get the discovery state (enabled or disabled) for the specified ...
  32.6  get_luns - Get LUNs of the specified iSCSI Target.
  32.7  get_sessions - Get a list of active iSCSI sessions.
  32.8  get_target_config - Get the iSCSI Target configuration. The list of configurable parameters ...
  32.9  get_target_props - Get iSCSI Target default and user-defined parameters.
  32.10  get_targets - List available iSCSI Targets. The result can be used to ...
  32.11  list_discovery - List the current discovery settings for the specified discovery method ...
  32.12  remove_target - Remove a set of specified target parameters
  32.13  set_default - Update the specified Initiator parameter. The list includes: InitiatorName, InitiatorAlias, ...
  32.14  set_target_config - Update the iSCSI Target configuration.
  32.15  setup_discovery - Setup iSCSI discovery
33  iSCSI Target
  33.1  delete_portal - Delete the specified Target Portal Group
  33.2  disable_comstar - Disable Common Multiprotocol SCSI Target (COMSTAR) and revert the appliance ...
  33.3  enable_comstar - Enable Common Multiprotocol SCSI Target (COMSTAR). Background: The appliance has ...
  33.4  get_defaults - Get the configured Target parameters. The list includes: RadiusServer, RadiusAccess, ...
  33.5  get_initiators - List all iSCSI Initiators connected to the specified Target ...
  33.6  get_portals - Get all configured Target Portal Groups
  33.7  get_zvol_props - For the specified zvol, get its iSCSI properties. The list ...
  33.8  is_comstar - Find out whether Common Multiprotocol SCSI Target (COMSTAR) is currently ...
  33.9  list_zvol - Retrieve zvol information from appliance's SCSI sub-system. This API is ...
  33.10  set_default - Update the specified Target parameter. The list of system-wide (global) ...
  33.11  set_portal - Add new or modify existing target portal group. Target Portal ...
  33.12  set_zvol_tpgt - Set Target Portal Group for a given zvol
  33.13  zvol_exists - Check if a given zvol exists. Background: the appliance provides ...
34  SMTP Mailer
35  Continuous Data Protection Service
36  Plugin
  36.1  get_group_names - Get array of all (or filtered) group names.
  36.2  get_group_plugins - Get array of all the plugins in a group ...
  36.3  get_group_props - Get dictionary with all the properties of a group, or ...
  36.4  get_ipc_info - Gets interface dicitonary { ipc_name => (name, suffix)} for given ...
  36.5  get_plugins_by_caps - Returns all plugins with required capability.
  36.6  list_remote - Get { plugin => plugin_properties } dictionary of all available ...
  36.7  preinst_check - Does plugin preinstallation checks, and returns values indicating if reboot ...
  36.8  resolve_lun_to_services - For a given zvol, get all services available on it. ...
  36.9  resolve_zfsname_to_services - Gets services running on a ZFS object.
37  Log Viewing Facility
  37.1  get_linecount - Get the current position (line number) in the file ...
  37.2  get_lines - Retrieve the specified number of lines from the log file ...
  37.3  get_tail - Retrieve file's tail
38  SCSI Target Mode Framework
  38.1  add_hostgroup_member - Adds a host to a hostgroup. The hostname should be ...
  38.2  add_targetgroup_member - Adds a target to a targetgroup. The targetname should be ...
  38.3  create_hostgroup - Creates an identifier for a hostgroup.
  38.4  create_targetgroup - Creates an identifier for a targetgroup.
  38.5  destroy_hostgroup - Destroys a previously created hostgroup.
  38.6  destroy_targetgroup - Destroys a previously created targetgroup.
  38.7  list_hostgroup_members - Returns a list of all the members of a host ...
  38.8  list_hostgroups - Returns a list of host group names.
  38.9  list_targetgroup_members - Returns a list of all the members of a target ...
  38.10  list_targetgroups - Returns a list of target group names.
  38.11  remove_hostgroup_member - Removes a host from a hostgroup.
  38.12  remove_targetgroup_member - Removes a target from a targetgroup.
39  iSCSI Target (COMSTAR)
  39.1  create_initiator - This method is related to initiators which are going to ...
  39.2  create_target - Creates a new iSCSI target. By default the system will ...
  39.3  create_tpg - Creates an iSCSI target portal group using a a set ...
  39.4  delete_initiator - Deletes a previously created initiator.
  39.5  delete_target - Deletes an iSCSI target.
  39.6  delete_tpg - Deletes a target portal group.
  39.7  get_defaults - Returns the global defaults used by the iSCSI target subsystem. ...
  39.8  get_target_list - Returns a list of targets in the system.
  39.9  get_target_props - Returns a dictionary of properties associated with an iSCSI target. ...
  39.10  list_initiators - Lists all initiators created by the user in the system ...
  39.11  list_tpg - Returns a list of the Target Portal Groups.
  39.12  modify_initiator - Modifies the properties of a previously created initiator.
  39.13  set_defaults - Sets the global defaults for all iSCSI targets.
  39.14  set_target_props - Updates properties associated with an iSCSI target.
40  SCSI disk
  40.1  add_lun_mapping_entry - Adds a lun mapping entry to the zvol so that ...
  40.2  create_lu - Initializes a zvol to be used as a SCSI Disk ...
  40.3  delete_lu - Deregisters a zvol being used as a SCSI Disk and ...
  40.4  get_lu_list - Returns a list of zvol names which are being registered ...
  40.5  get_lu_props - Returns a dictionary of properties associated with zvol as SCSI ...
  40.6  import_lu - Re-registers a zvol as a SCSI Disk. The zvol must ...
  40.7  list_lun_mapping_entries - For a given zvol, list all the lun mapping entries ...
  40.8  realign_size - Re-adjust zvol size. In some rare cases, zvol size stored ...
  40.9  remove_lun_mapping_entry - Removes a lun mapping entry from a zvol.
  40.10  resolve_lun_to_targets - For a given zvol, get all targets that can be ...
  40.11  set_lu_props - Sets the properties associated with zvol as SCSI Disk. ...
  40.12  writeback_cache_disable - Disable write-back cache on a given zvol. When disabled, all ...
  40.13  writeback_cache_enable - Enable write-back cache on a given zvol.
  40.14  writeprotect_disable - Disable write protection on a given zvol device. When enabled, ...
  40.15  writeprotect_enable - Enable write protection on a given zvol device. When enabled, ...
41  Examples and Usage Cases
  41.1  C/C++ - Examples in C/C++
  41.2  Perl - Examples in Perl
  41.3  Python - Examples in Python
  41.4  Ruby - Examples in Ruby

1  API Overview

Welcome to the NexentaStor Storage Appliance API (SA-API) Reference documentation. This API reference provides comprehensive information allowing to build new and extend existing management services, management clients and applications on top of NexentaStor.

Storage Appliance API (SA-API) uses RPC-like D-Bus protocol that employes TCP/IP transport. D-Bus is a powerful and flexible inter-process communication (IPC) mechanism that allows: for the service providers - to register the provided services, and for the clients - to lookup on the network and use the provided services in a location-independent way. NexentaStor leverages D-Bus to provide universal and comprehensive API to manage and monitor all aspects of the appliance's operation. For more information on dbus visit the D-Bus Project Homepage. There are many good introductions and tutorials available on the web, including for instance this D-Bus Tutorial.

Since SA-API provides a higher level abstraction on top of D-Bus, knowledge of these materials is, however, not a prerequisite. SA-API makes it easy to create new, or modify existing applications in C or C++, Perl, Python or Ruby. More language specific SA-API extensions may be added in the future. Still, for reference purposes the corresponding sources are listed below:

LANGUAGE COMMENT
C/C++SA-API is layered on top native libraries for Windows, Linux and MacOSX operating systems. The libraries are provided with the NexentaStor software development kit (SDK). NexentaStor SDK contains tutorials and examples written in C and C++.
PerlSA-API uses Perl D-Bus bindings realized via Net::DBus package. The package comes with Perl tutorials and Perl examples.
PythonSA-API utilizes Pythin D-Bus bindings. Similarly, the Python D-Bus Tutorial contains easy introduction and multiple Python examples.
RubySA-API is layered on top of Ruby D-bus bindings. The Ruby D-Bus project contains reference documentation, Ruby tutorials and examples.

The API provides access to the appliance's management objects and services. The appliance's management object hierarchy includes: lun, volume, folder, snapshot, network, network interface, network service, storage service, indexer, zvol, statistic collector, fault trigger, reporter, and others. Each object implements and publishes a part of the API, which makes the latter a by-product of two interrelated but still distinctly separate driving "forces": the appliance's object taxonomy and the required functionality of the 2nd tier NAS.

All client management applications use SA-API to monitor and administer the appliance. This ensures consistent view of the appliance from all clients, transactional behavior of all management administrative and monitoring operations, and easy third-party integrations.

The currently existing management clients include: management console (NMC) and web GUI (Nexenta Management View a.k.a. NMV), fault triggers and storage services, statistic collectors and daily/weekly reporters. All of them execute management operations first by acquiring an object proxy, and second, by calling one of the object's APIs. The SA-API supports many-to-many operation, in the sense that it allows to communicate to multiple statically bound or dynamically discovered appliances on the Internet/Intranet, and at the same time supports multi-user access to any given appliance.

SA-API has bindings for C, C++, Perl, Python and Ruby. This documentation contains examples and samples to demonstrate SA-API in these languages.

The prerequisites to using SA-API include:

The API can be used to take the full advantage of the NexentaStor capabilities, which include unlimited including unlimited incremental backups or 'snapshots', snapshot mirroring (replication), block level mirroring ('CDP'), integrated search, and the inherent virtualization, performance, thin provisioning and more. The following block diagram shows Nexenta Management Server - the sole provider of the API - and some of its clients.

2  Block Diagram

NexentaStor Architecture Block Diagram

3  Terms and Conventions

DOCUMENT CONVENTION COMMENT
value1 | value2 ...Enumeration. The '|' delimited list denotes enumerated list of values. For instance, 0 | 1 specifies a boolean value (passed as a parameter or returned by an SA-API method call) that can have one of the listed values: 0 or 1
true, falseAs far as SA-API and this document, "true" and "non-zero" on one hand, and "false" and "zero" on another are used interchangeably. There are no special "true" and "false" values. The preferred way to pass a boolean value in a method call is to specify 1, although you may use any non-zero value
array of (item-type)Array of items of the type 'item-type'. In this document, round brackets () are used to denote linear arrays containing items of the same type. For instance, 'array of (string)' means arrays of strings. Specification 'array of (string) foo()' indicates that the method foo() returns array of strings. Simlarly, 'bar (array of (string) param)' means that the type of the 1st argument of the method bar() is an array of strings. For more information on the SA-API data types, please see Section Data Types below.
dictionary {key-type => value-type}Dictionary of records, whereby each record has a key of type 'key-type' and a value of type 'value-type'. By convention, curly braces {} denote dictionaries. For more information on the SA-API data types, please see Section Data Types below

TERM COMMENT
SA-APINexentaStor Storage Appliance application programming interface
NMSNexenta Management Server, the sole provider of the SA-API
NMCNexenta Management Console, the appliance's management CLI
VolumeNexentaStor volume is a ZFS pool with certain additional attributes. There is a one-to-one relationship between a volume and the underlying ZFS pool
FolderNexentaStor folder is a ZFS filesystem
AutoSnap, AutoTier, AutoSync, AutoCdpTypes of appliance's storage services. For more information, please refer to NexentaStor User Guide
RunnerTriggers, Collectors, Reporters, and Indexers - also commonly called "runners" - are pluggable modules that perform specific Fault Management, Performance Monitoring, Reporting, and archive Indexing tasks. All specific runners inherit Virtual Runner SA-API interfaces
LunPhysical and logical drives, attached to the appliance directly or via iSCSI or FC SAN, are commonly called LUNs. The terms "LUN", "hard drive" and "disk" are used interchangeably
ZvolEmulated (virtual) block device based on a given appliance's volume

4  Object Model

NexentaStor management object model is designed to provision, manage, monitor, and control the life-cycle of all components that comprise the appliance, including network and data services, volumes (pools) and folders (filesystems), snapshots and zvols (virtual block devices), LUNs (physical and virtual disks), and more. The management architecture is in basic ways similar to CORBA and Java RMI, whereby object proxies on the client side are used to represent remote (implementation) objects, on a remote appliance.

The following lists all SA-API proxy objects - interface objects representing appliance's objects and services. The table comprises the following information:

NexentaStor SDK comes with a number of local (client-side) helpers. This includes nms_client_init() - to initialize SA-API client, and nms_remote_obj() - to acquire SA-API interface proxy object associated with a given appliance (identified by its hostname or IP address). Both nms_client_init() and nms_remote_obj() are provided with the language-specific bindings and demonstrated in the Section Examples and Usage Cases below.

SA-API interface (proxy) objectD-Bus nameReference sectionInherits
appliance'/Root/Appliance'General Appliance ManagementVirtual Base Object
applgroup'/Root/ApplGroup'Groups of Appliances ManagementVirtual Container
runner'/Root/Runner'Virtual RunnerVirtual Container
trigger'/Root/Runner/Trigger'Fault ManagementVirtual Runner
collector'/Root/Runner/Collector'Statistics CollectionVirtual Runner
reporter'/Root/Runner/Reporter'Reporting Facility (Services, Performance, Capacity)Virtual Runner
indexer'/Root/Runner/Indexer'Folder and Snapshot Indexing Facility (Search Engine)Virtual Runner
lun'/Root/Lun'Logical and Physical Disk ManagementVirtual Container
volume'/Root/Volume'Volume (Pool)Virtual Container
zvol'/Root/Zvol'Zvol (Emulated Volume-based Block Device)Virtual Container
folder'/Root/Folder'Folder (Filesystem)Virtual Container
snapshot'/Root/Snapshot'Snapshot ManagementVirtual Container
smf'/Root/Smf'Service Management Facility (SMF)Virtual Container
autosvc'/Root/Smf/AutoService'Virtual Automatic Storage ServiceService Management Facility (SMF)
auto_scrub'/Root/Smf/AutoService/AutoScrub'AutoScrub (volume scrubbing) ServiceVirtual Automatic Storage Service
auto_snap'/Root/Smf/AutoService/AutoSnap'AutoSnap (snapshot) ServiceVirtual Automatic Storage Service
auto_sync'/Root/Smf/AutoService/AutoSync'AutoSync (data replication) ServiceVirtual Automatic Storage Service
auto_tier'/Root/Smf/AutoService/AutoTier'AutoTier (data replication) ServiceVirtual Automatic Storage Service
netsvc'/Root/Smf/NetworkService'Network Services ManagementService Management Facility (SMF)
syspool'/Root/Syspool'System Upgrade, Rollback and Checkpoint ManagementVolume (Pool)
netstorsvc'/Root/NetworkStorageService'Network Storage ServiceVirtual Container
server'/Root/Server'Nexenta Management ServerVirtual Base Object
network'/Root/Network'Network ManagementVirtual Base Object
netif'/Root/Network/Interface'Network Interfaces ManagementVirtual Container
iscsi'/Root/Iscsi'iSCSI InitiatorVirtual Base Object
iscsitgt'/Root/IscsiTgt'iSCSI TargetVirtual Base Object
mailer'/Root/Mailer'SMTP MailerVirtual Base Object
autocdp'/Root/AutoCdp'Continuous Data Protection ServiceVirtual Container
plugin'/Root/Plugin'PluginVirtual Container
logviewer'/Root/LogViewer'Log Viewing FacilityVirtual Base Object
stmf'/Root/Stmf'SCSI Target Mode FrameworkVirtual Base Object
iscsi_target'/Root/Stmf/IscsiTarget'iSCSI Target (COMSTAR)Virtual Container
scsi_disk'/Root/Stmf/ScsiDisk'SCSI diskVirtual Container

All SA-API interface objects without exception are extensions of SA-API generic Virtual Object. Thus, all methods provided by the Virtual Object are polymorphically available via SA-API interface objects listed in the table above. For instance, appliance->get_props() returns appliance's properties, as per com.nexenta.nms.Object::get_props specification.

Majority of the listed SA-API interface objects extend Virtual Container interface. SA-API Container is an abstraction to aggregate multiple objects of the same type: snapshots, volumes, folders, network services, network interfaces, runners, LUNs (disks), storage services. A typical sequence of steps to execute an operation on a specific (contained) object instance includes:

SA-API Virtual Container abstraction is repeatedly demonstrated throughout this reference; for specific examples in C, Perl, Python and Ruby please refer to Section Examples and Usage Cases below.

5  Data Types

SA-API "data type" is either a primitive data type or a complex type built based on the primitive data types, similar to abstract data types in Java and struct data types in C and C++. SA-API data types are used to define arguments and return values in the SA-API methods listed in this reference documentation. The primitive data types include:

PRIMITIVE DATA TYPE DESCRIPTION
string zero terminated string of bytes
int32 integer value
bool bolean value: 0 - false, 1 - true

The complex data types are:

COMPLEX DATA TYPE DESCRIPTION
array linear array containing items of the same data type. By convention, an array is denoted as (type), where type is typically one of the primitive types listed above. For instance, notation "array of (string)" means arrays of strings
dictionary dictionary or hash containing records of data. Each record in the dictionary has two distinct elements: key and value, whereby the key can be used to access the value directly. Throughout this documentation, dictionaries are denoted using curly braces {}, for instance: dictionary { string => bool } would mean a dictionary containing records consisting of two primitive elements: string key and boolean value

Rest of this section demonstrates usage of these SA-API data types in different languages.

5.1  Primitive Data Types

As far as Perl, Python and Ruby, SA-API primitive types are in fact the corresponding programming language's primitive types: no translation necessary. The next table shows a correspondence between D-Bus and C/C++ data types:
PRIMITIVE DATA TYPE C/C++ TYPE
string DBUS_TYPE_STRING
int32 DBUS_TYPE_INT32
bool DBUS_TYPE_BOOLEAN

None of the primitive data types require any special preparation for using it as an argument in the SA-API method call: it is enough to declare a C variable using one of the listed DBUS_TYPE_??? primitives, and then pass a pointer to it in an SA-API method call.

Processing SA-API results is also easy. The following example prints a string  returned by an SA-API call

	char *str;
	if (nms_get_basic (msg, DBUS_TYPE_STRING, &str))
		printf ("Received = %s\n", str);
		else printf ("Error getting string  value");
For a complete example in C, see Section C/C++ below.

5.2  Receiving an Array

The following example in C prints an array type returned by an SA-API method; this type of array is denoted in this document as array of (string)

	char **array;
	int count, i;
	count = nms_get_basic (msg, DBUS_TYPE_CHAR_ARRAY, &array);
	for (i = 0; i < count; i++){
		printf ("item = %s\n", array[i]);
	};

This snippet of Perl code simply prints a returned array of strings denoted in this document as array of (string). Note that SA-API complex data type array  is a regular Perl array, while SA-API dictionary  is simply a Perl hash.

	for my $item (@$array) {
		print "item=$item\n";
	}
For a complete and working example in Perl, see Section Perl below.

5.3  Receiving a Dictionary

The following example in C prints a dictionary type returned by an SA-API method; this type of dictionary is denoted in this document as dictionary {string => string}

	char **dict;
	int count, i;
	count = nms_get_basic (msg, DBUS_TYPE_CHAR_DICT, &dict);
	for (i = 0; i < count; i++){
		printf ("%s => %s\n", dict[i * 2], dict[i * 2 + 1]);
	};
For a complete example in C, see Section C/C++ below.

Next is a Perl code sample that does the same: prints a returned dictionary {string => string}. Note that complex data types are always returned by reference.

	for my $key (keys %$dict) {
		print "key=$key, value=$dict->{$key}\n";
	}

5.4  Passing an Array

The following example in C prepares an array of strings denoted in this document as array of (string), to further be passed as a parameter in an SA-API method call:

	char *array[] = {
		"a", "b", "c", "d"
		};

This single-line Perl code fills an array of strings, to be passed as a parameter in SA-API method invocation:

	my @array = ('a', 'b', 'c', 'd');

5.5  Passing a Dictionary

The following example in C prepares a dictionary {string => string}, to further be passed as a parameter in an SA-API method call:

	char *dict[] = {
		"name", "appliance", 
		"version", "1.0",
		"release_date", "06/17/2008"
		};
For a complete example in C, see Section C/C++ below.

Next is a Perl example that fills in the same type of a dictionary {string => array of (string)}, to be transferred to the remote appliance for execution, for instance in a call to modify user's ACL:

	my %dict = (
		allow => ['read_data', 'read_acl'],
		deny => ['write_data']
	);

Note again that SA-API dictionary  is a regular Perl hash. For a complete example in Perl, see Section Perl below.

6  Virtual Base Object

Properties
NAMEDESCRIPTION
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
nameThe name of the object

6.1  com.nexenta.nms.Object::get_prop

string  get_prop (string propname)

Get property value

Parameters
NAMETYPEDESCRIPTION
propnamestringThe name of the property
Return Value
TYPEDESCRIPTION
stringProperty value
Usage Examples
1.  appliance_if->get_prop('nms_version') 

Get NMS version for the NMS that runs on a given appliance. This assumes that appliance_if is interface object that represents the corresponding appliance

2.  server_if->get_prop('trace_level') 

Get NMS trace level. This assumes that server_if represents NMS server interface object

See Also
MethodShort Description
com.nexenta.nms.Object::get_propsGet { propname => value } dictionary of all properties ...
com.nexenta.nms.Object::set_propSet property value
com.nexenta.nms.Container::get_child_propFor a given (contained) child, get the specified property ...

Next Section: Virtual Container

6.2  com.nexenta.nms.Object::get_props

dictionary {string => string}  get_props (string pattern)

Get { propname => value } dictionary of all properties matching the specified pattern

Parameters
NAMETYPEDESCRIPTION
patternstringPattern to select a matching subset of object's properties. An empty string will match all object's properties
Return Value
TYPEDESCRIPTION
dictionary {string => string}{ Property Name => Property Value } dictionary for all properties matching the specified pattern
Usage Examples
1.  appliance_if->get_props('^n') 

Assuming appliance_if is the corresponding interface object, return all appliance's properties the names of which start with the letter 'n'. This list may look as follows: { 'name' => 'Appliance', 'nms_version' => '1.1' }

See Also
MethodShort Description
com.nexenta.nms.Object::get_propGet property value
com.nexenta.nms.Object::set_propSet property value
com.nexenta.nms.Container::get_child_propFor a given (contained) child, get the specified property ...

Next Section: Virtual Container

6.3  com.nexenta.nms.Object::set_prop

void  set_prop (string propname, string value)

Set property value

Parameters
NAMETYPEDESCRIPTION
propnamestringThe name of the property
valuestringNew value of the property
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  server_if->set_prop('trace_level', '10') 

Assuming server_if represents NMS server interface object, this will set its tracing level to 10

See Also
MethodShort Description
com.nexenta.nms.Object::get_propGet property value
com.nexenta.nms.Container::set_child_propFor a given (contained) child update the specified property with ...
com.nexenta.nms.Container::get_child_propFor a given (contained) child, get the specified property ...

Next Section: Virtual Container

7  Virtual Container

Properties
NAMEDESCRIPTION
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
nameThe name of the object

7.1  com.nexenta.nms.Container::destroy

void  destroy (string child_name)

Destroy child object specified by its name

Parameters
NAMETYPEDESCRIPTION
child_namestringThe name of the child object.
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Volume::destroyDestroy the specified volume and free up devices it uses. ...
com.nexenta.nms.Folder::destroyDestroy a given folder, its sub-folders and snapshots. The operation ...
com.nexenta.nms.Snapshot::destroyDestroy the specified snapshot

Previous Section: Virtual Base ObjectTable Of ContentsNext Section: General Appliance Management

7.2  com.nexenta.nms.Container::get_child_prop

string  get_child_prop (string child_name, string propname)

For a given (contained) child, get the specified property

Parameters
NAMETYPEDESCRIPTION
child_namestringThe name of the child object contained by the specified container object. For instance, assuming lun_if represents LUN container, lun_if->get_child_prop('c0d0', 'size') returns the 'size' property value of the contained (child) object - 'c0d0' IDE disk, in this case
propnamestringThe name of the property. Use com.nexenta.nms.Container::get_child_props to retrieve the list of available properties at runtime.
Return Value
TYPEDESCRIPTION
stringThe value of the specified property for the specified child object
Usage Examples
1.  lun_if->get_child_prop('c2t0d0', 'size') 

Get the size of 'c2t0d0'

2.  network_interfaces_if->get_child_prop('e1000g0', 'info') 

Get information on the 'e1000g0' interface. This assumes that the network_interfaces_if represents the corresponding container object (that contains all network interfaces on a given appliance).

See Also
MethodShort Description
com.nexenta.nms.Object::get_propGet property value
com.nexenta.nms.Object::set_child_prop
com.nexenta.nms.Container::get_child_propsFor a given (contained) child get { propname => value ...

Previous Section: Virtual Base ObjectTable Of ContentsNext Section: General Appliance Management

7.3  com.nexenta.nms.Container::get_child_props

dictionary {string => string}  get_child_props (string child_name, string pattern)

For a given (contained) child get { propname => value } dictionary of all properties matching the specified pattern

Parameters
NAMETYPEDESCRIPTION
child_namestringThe name of the child object contained by the specified container object. For instance, assuming lun_if represents LUN container, lun_if->get_child_props('c0d0', '') returns all properties and values of the contained (child) object - 'c0d0'.
patternstringPattern to select a matching subset of child's properties. An empty string will match all object's properties
Return Value
TYPEDESCRIPTION
dictionary {string => string}Dictionary { Property Name => Value }
Usage Examples
1.  plugin('nms-autocdp')->get_child_props('tier2', '') 

Ask nms-autocdp plugin interface object for all properties of the existing auto-cdp 'tier2' instance that the former contains. This, and the following examples, assume that the container interface (nms-autocdp plugin in this case) is already retrieved (as described elsewhere), and represents the corresponding container on a given appliance.

2.  lun_if->get_child_props('c2t0d0', '') 

Get all 'c2t0d0' disk properties

3.  lun_if->get_child_props('c2t0d0', 'size') 

Get properties that match 'size' substring for the 'c2t0d0'. Following is an example of returned dictionary: { 'size' => '4.1GB', 'size_bytes' => 4294967296 }

4.  folder_if->get_child_props('vol1/a', '') 

Get all 'vol1/a' folder properties

5.  volume_if->get_child_props('vol1', '') 

Get all 'vol1' volume properties

6.  snapshot_if->get_child_props('vol1/a@today', '') 

Get all 'vol1/a@today' snapshot properties

7.  folder_if->get_child_props('vol1/a', 'mount') 

Get all mount-related properties of the folder 'vol1/a'. The returned dictionary may look as follows: { 'mounted' => 'yes', 'canmount' => 'on', 'mountpoint' => '/volumes/vol1/a' }.

See Also
MethodShort Description
com.nexenta.nms.Object::get_propGet property value
com.nexenta.nms.Container::set_child_propFor a given (contained) child update the specified property with ...
com.nexenta.nms.Container::get_child_propFor a given (contained) child, get the specified property ...

Previous Section: Virtual Base ObjectTable Of ContentsNext Section: General Appliance Management

7.4  com.nexenta.nms.Container::get_names

array of (string)  get_names (string pattern)

Get array of all (contained) children names matching the specified pattern

Parameters
NAMETYPEDESCRIPTION
patternstringPattern to select a matching subset of (contained) children objects. An empty string will match all contained (existing) children
Return Value
TYPEDESCRIPTION
array of (string)Array of children matching the specified pattern
Usage Examples
1.  folder_if->get_names('^vol1/a/') 

Recursively get all sub-folders of the folder 'vol1/a'. The returned array ma look like: ( 'vol1/a/b', 'vol1/a/c', 'vol1/a/b/ddd' )

2.  network_interfaces_if->get_names('') 

Get all existing network interfaces. An example of return: ( 'e1000g0', 'e1000g1', 'e1000g2' )

3.  volume_if->get_names('') 

Get all volumes

4.  zvol_if->get_names('') 

Get all zvols

5.  snapshot_if->get_names('^vol1\/a[\/\@]') 

Recursively get all snapshots of the folder 'vol1/a' and its sub-folders. An example of returned array: ( 'vol1/a@yesterday', 'vol1/a@today', 'vol1/a/b@yesterday' )

See Also
MethodShort Description
com.nexenta.nms.Container::get_names_by_propGet array of all (container) children which has matching property ...
com.nexenta.nms.Folder::get_namesGet folder names matching a specified pattern
com.nexenta.nms.Volume::get_namesGet volume names matching a specified pattern

Previous Section: Virtual Base ObjectTable Of ContentsNext Section: General Appliance Management

7.5  com.nexenta.nms.Container::get_names_by_prop

array of (string)  get_names_by_prop (string propname, string propval_pattern, string childname_pattern)

Get array of all (container) children which has matching property value, for the names matching the 2nd specified pattern. The method effectively does the following: select all children where child name matches and property matches . As always, an empty pattern value means that the pattern is ignored.

Parameters
NAMETYPEDESCRIPTION
propnamestringThe name of the property. For each appliance's container object (folder, volume, zol, smf, runner, etc.) - the list of its properties is documented elsewhere. At runtime, use com.nexenta.nms.Container::get_child_props to retrieve the list of all available properties
propval_patternstringPattern to select only those children that have the property with the value that matches
childname_patternstringPattern to select a matching subset of (contained) children objects. An empty string will match all contained (existing) children
Return Value
TYPEDESCRIPTION
array of (string)Array of children matching the specified criteria
Usage Examples
1.  lun_if->get_names_by_prop('type', 'cdrom', '') 

Get names of all CD-ROMs in the appliance

2.  runner_if->get_names_by_prop('type', 'collector', '') 

Get all collectors. The resulting returned array may look like: ( 'network-collector', 'nfs-collector', 'volume-collector' )

3.  runner_if->get_names_by_prop('type', 'collector', '^v') 

Get a subset of all collectors with the names starting with 'v'

See Also
MethodShort Description
com.nexenta.nms.Container::get_namesGet array of all (contained) children names matching the specified ...
com.nexenta.nms.Folder::get_namesGet folder names matching a specified pattern
com.nexenta.nms.Snapshot::get_namesGet snapshot names matching a specified pattern

Previous Section: Virtual Base ObjectTable Of ContentsNext Section: General Appliance Management

7.6  com.nexenta.nms.Container::object_exists

bool  object_exists (string child_name)

Verify that object exists

Parameters
NAMETYPEDESCRIPTION
child_namestringThe name of the child object.
Return Value
TYPEDESCRIPTION
boolTrue (non-zero) if the specified child exists. Otherwise, zero (false).
Usage Examples
1.  lun_if->object_exists('c0d0') 

Returns non-zero if the appliance has 'c0d0' disk

2.  folder_if->object_exists('vol1/a') 

Returns non-zero if the folder 'vol1/a' exists

See Also
MethodShort Description
com.nexenta.nms.Container::get_namesGet array of all (contained) children names matching the specified ...
com.nexenta.nms.Container::get_names_by_propGet array of all (container) children which has matching property ...

Previous Section: Virtual Base ObjectTable Of ContentsNext Section: General Appliance Management

7.7  com.nexenta.nms.Container::set_child_prop

void  set_child_prop (string child_name, string propname, string propvalue)

For a given (contained) child update the specified property with a new value

Parameters
NAMETYPEDESCRIPTION
child_namestringThe name of the child object contained by the specified container object. For instance, assuming folder_if represents the corresponding folder container, folder_if->set_child_prop('vol1/a', 'compression', 'on') enables compression on the folder 'vol1/a'
propnamestringThe name of the property. Use com.nexenta.nms.Container::get_child_props to retrieve the list of available properties at runtime.
propvaluestringNew value of the property
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  folder_if->set_child_prop('vol1/a', 'compression', 'on') 

Enable compression on the folder 'vol1/a'

2.  zvol_if->set_child_prop('vol1/zvol1', 'shareiscsi', 'on') 

Share zvol 'vol1/zvol1' via iSCSI

See Also
MethodShort Description
com.nexenta.nms.Object::get_propGet property value
com.nexenta.nms.Object::set_propSet property value
com.nexenta.nms.Container::get_child_propFor a given (contained) child, get the specified property ...

Previous Section: Virtual Base ObjectTable Of ContentsNext Section: General Appliance Management

7.8  com.nexenta.nms.Container::trylock

bool  trylock (string child_name, int32 lock_type)

Make an attempt to lock the specified child

Parameters
NAMETYPEDESCRIPTION
child_namestringThe name of the child object.
lock_typeint32lock_type = 1 | 2. Type of the lock. The two valid values are: 1 - read lock, 2 - write lock. Read lock allows multiple concurrent readers accessing the corresponding (locked) object, but will conflict with an attempt to take a write lock. The write lock is exclusive.
Return Value
TYPEDESCRIPTION
boolNon-zero (true) if the lock succeded. Otherwise, zero (false).
Usage Examples
1.  folder_if->trylock('vol1/a', 1) 

Lock folder 'vol1/a' for reading. Note that multiple read locks may co-exist simultaneously

2.  folder_if->trylock('vol1/a', 2) 

Exclusively lock folder 'vol1/a' and its sub-folders.

See Also
MethodShort Description
com.nexenta.nms.Container::unlockUnlock the specified child
com.nexenta.nms.Container::object_existsVerify that object exists

Previous Section: Virtual Base ObjectTable Of ContentsNext Section: General Appliance Management

7.9  com.nexenta.nms.Container::unlock

void  unlock (string child_name, int32 lock_type)

Unlock the specified child

Parameters
NAMETYPEDESCRIPTION
child_namestringThe name of the child object.
lock_typeint32lock_type = 1 | 2. Type of the lock to unlock. The two valid values are: 1 - read lock, 2 - write lock
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  folder_if->unlock('vol1/a', 1) 

Remove read lock from the folder 'vol1/a'

2.  folder_if->unlock('vol1/a', 2) 

Remove write (exclusive) lock from the folder 'vol1/a'

See Also
MethodShort Description
com.nexenta.nms.Container::trylockMake an attempt to lock the specified child
com.nexenta.nms.Container::object_existsVerify that object exists
com.nexenta.nms.Container::destroyDestroy child object specified by its name

Previous Section: Virtual Base ObjectTable Of ContentsNext Section: General Appliance Management

8  General Appliance Management

SA-API Interface Object

D-Bus name Interface class name Inherits
/Root/Appliancecom.nexenta.nms.ApplianceVirtual Base Object
Properties
NAMEDESCRIPTION
domainnameDomain name. For instance: mydomain.com.
hostnameHost name.
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
is_trialTBD
kbd_layoutKeyboard layout - specific mechanical, visual, or functional arrangement of the keys. Storage Appliance supports a wide variety of keyboard layouts, including all QWERTY based layouts.
license_agreementTBD
modelAppliance's model. Specifies a combination of appliance's model ID (unified or virtual) and a type of the software license. For instance: "Unified Storage Appliance (Developer Edition)".
model_idmodel_id = STOR_UNIFIED | STOR_VIRTUAL. Specifies appliance's model ID. Currently there are two model IDs: "STOR_UNIFIED" - unified, bare-metal installable appliance, and "STOR_VIRTUAL" - pre-installed VMware image (virtual) appliance.
nameThe name of the object
nms_versionNMS version, the version of the Nexenta Management Server.
num_cpu_coresNumber of CPU cores, that is total number of online processors in the system. Note that a physical CPU may support multiple cores.
os_versionOS version, the version of the underlying Nexenta Operating System (NexentaOS). The versioning scheme includes specification of the OpenSolaris kernel build, for instance "b85" for build 85. The complete string may look as follows: "1.0.1b85".
product_familyproduct_family = "NexentaStor". There is currently a single product family, but this may change in the future.
release_dateActual release date of the appliance's software, as a number of seconds since the start of epoch (00:00:00 UTC Jan 1st, 1970). For instance: '1210987793' would mean certain time of a day on for May 16, 2008
timezoneTime Zone, for instance "US/Pacific".
uuidUUID, or Universally Unique Identifier of the platform. Typically retrieved via smbios or equivalent.
x86_instruction_setx86 instruction set = '64bit' | '32bit'
Inherited Methods
NAMEPROTOTYPE
com.nexenta.nms.Object::get_propstring  get_prop (string propname)
com.nexenta.nms.Object::get_propsdictionary {string => string}  get_props (string pattern)
com.nexenta.nms.Object::set_propvoid  set_prop (string propname, string value)

8.1  com.nexenta.nms.Appliance::add_swap

void  add_swap (string zname)

Add zvol as an additional swap area

Parameters
NAMETYPEDESCRIPTION
znamestringZvol pathname, for instance 'vol1/zvol1', where vol1 would be the name of an underlying volume
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Appliance::list_swapGet summary information about total swap space usage, existing swap ...
com.nexenta.nms.Appliance::delete_swapRemove zvol swap area - undo the effect of com.nexenta.nms.Appliance::add_swap ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.2  com.nexenta.nms.Appliance::dbus_auth_iptable_is_set

bool  dbus_auth_iptable_is_set (string action, string mask_ip)

Determine whether the specified deny or allow access rule is present in the appliance's iptable.

Parameters
NAMETYPEDESCRIPTION
actionstringaction = 'allow' | 'deny'
mask_ipstringmask_ip = IPv4 mask or IPv4 address
Return Value
TYPEDESCRIPTION
bool0 | 1. Returns 1 (true) if the specified rule is present, 0 (false) if not.
See Also
MethodShort Description
com.nexenta.nms.Appliance::dbus_auth_iptable_setDeny or allow access to the appliance from the specified ...
com.nexenta.nms.Appliance::dbus_auth_iptable_listGet all iptable access rules. Background: The appliance provides secure ...
com.nexenta.nms.Appliance::dbus_auth_iptable_unsetRemove deny or allow access rule from the appliance's iptable. ...
com.nexenta.nms.Appliance::dbus_auth_iptable_listGet all iptable access rules. Background: The appliance provides secure ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.3  com.nexenta.nms.Appliance::dbus_auth_iptable_list

dictionary {string => string}  dbus_auth_iptable_list (void)

Get all iptable access rules. Background: The appliance provides secure access to other Storage Appliances, as well as administrative management client applications on the network. The inter-appliance access is executed either via SSH, or via SA-API (User Guide, Section "Storage Appliance API"), or both. All management client applications, whether developed internally by Nexenta Systems, Inc and/or by 3rd parties, access appliance via SA-API. In all cases, access to an appliance requires client authentication. SA-API supports two authentication mechanisms: 1) via IP address of the client machine, and 2) via ssh-keygen generated authentication keys. The 2nd, ssh-keygen based, mechanism is the preferred one. This (2nd) mechanism is realized via APIs: com.nexenta.nms.Appliance::dbus_auth_keys_add, com.nexenta.nms.Appliance::dbus_auth_keys_remove, com.nexenta.nms.Appliance::dbus_auth_keys_list. This is the mechanism used by Storage Appliances to communicate between themselves. The latter is required to run storage replication services, to execute in a group mode, to switch between appliances for the purposes of centralized management. Once the appliances are ssh-bound, all SA-API interfaces become available, and get executed in a secure way. Please see User Guide Sections "Centralized Management" and "Secure Access" for more information.

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
dictionary {string => string}Dictionary { string => string }, where key = IPv4 mask or IPv4 address, and value = 'allow' | 'deny'
See Also
MethodShort Description
com.nexenta.nms.Appliance::dbus_auth_iptable_setDeny or allow access to the appliance from the specified ...
com.nexenta.nms.Appliance::dbus_auth_iptable_listGet all iptable access rules. Background: The appliance provides secure ...
com.nexenta.nms.Appliance::dbus_auth_iptable_unsetRemove deny or allow access rule from the appliance's iptable. ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.4  com.nexenta.nms.Appliance::dbus_auth_iptable_set

void  dbus_auth_iptable_set (string action, string mask_ip)

Deny or allow access to the appliance from the specified IP address or subnet. This API results in adding another matching rule to the appliance's iptable. Background: The appliance provides secure access to other Storage Appliances, as well as administrative management client applications on the network. The inter-appliance access is executed either via SSH, or via SA-API (User Guide, Section "Storage Appliance API"), or both. All management client applications, whether developed internally by Nexenta Systems, Inc and/or by 3rd parties, access appliance via SA-API. In all cases, access to an appliance requires client authentication. SA-API supports two authentication mechanisms: 1) via IP address of the client machine, and 2) via ssh-keygen generated authentication keys

Parameters
NAMETYPEDESCRIPTION
actionstringaction = 'allow' | 'deny'
mask_ipstringmask_ip = IPv4 mask or IPv4 address
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Appliance::dbus_auth_iptable_unsetRemove deny or allow access rule from the appliance's iptable. ...
com.nexenta.nms.Appliance::dbus_auth_iptable_listGet all iptable access rules. Background: The appliance provides secure ...
com.nexenta.nms.Appliance::dbus_auth_iptable_is_setDetermine whether the specified deny or allow access rule is ...
com.nexenta.nms.Appliance::dbus_auth_iptable_listGet all iptable access rules. Background: The appliance provides secure ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.5  com.nexenta.nms.Appliance::dbus_auth_iptable_unset

void  dbus_auth_iptable_unset (string action, string mask_ip)

Remove deny or allow access rule from the appliance's iptable. This is to reverse effect of com.nexenta.nms.Appliance::dbus_auth_iptable_set.

Parameters
NAMETYPEDESCRIPTION
actionstringaction = 'allow' | 'deny'
mask_ipstringmask_ip = IPv4 mask or IPv4 address
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Appliance::dbus_auth_iptable_setDeny or allow access to the appliance from the specified ...
com.nexenta.nms.Appliance::dbus_auth_iptable_listGet all iptable access rules. Background: The appliance provides secure ...
com.nexenta.nms.Appliance::dbus_auth_iptable_is_setDetermine whether the specified deny or allow access rule is ...
com.nexenta.nms.Appliance::dbus_auth_iptable_listGet all iptable access rules. Background: The appliance provides secure ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.6  com.nexenta.nms.Appliance::dbus_auth_keys_add

void  dbus_auth_keys_add (string key, string value)

Add new key to the client key authorization table. Background: The appliance provides secure access to other Storage Appliances, as well as administrative management client applications on the network. The inter-appliance access is executed either via SSH, or via SA-API (User Guide, Section "Storage Appliance API"), or both. All management client applications, whether developed internally by Nexenta Systems, Inc and/or by 3rd parties, access appliance via SA-API. In all cases, access to an appliance requires client authentication. SA-API supports two authentication mechanisms: 1) via IP address of the client machine, and 2) via ssh-keygen generated authentication keys. The 2nd, ssh-keygen based, mechanism is the preferred one. This (2nd) mechanism is realized via APIs: com.nexenta.nms.Appliance::dbus_auth_keys_add, com.nexenta.nms.Appliance::dbus_auth_keys_remove, com.nexenta.nms.Appliance::dbus_auth_keys_list. This is the mechanism used by Storage Appliances to communicate between themselves. The latter is required to run storage replication services, to execute in a group mode, to switch between appliances for the purposes of centralized management. Once the appliances are ssh-bound, all SA-API interfaces become available, and get executed in a secure way. Please see User Guide Sections "Centralized Management" and "Secure Access" for more information.

Parameters
NAMETYPEDESCRIPTION
keystringKey identifier.
valuestringRSA key value.
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Appliance::dbus_auth_iptable_setDeny or allow access to the appliance from the specified ...
com.nexenta.nms.Appliance::dbus_auth_iptable_listGet all iptable access rules. Background: The appliance provides secure ...
com.nexenta.nms.Appliance::dbus_auth_iptable_unsetRemove deny or allow access rule from the appliance's iptable. ...
com.nexenta.nms.Appliance::dbus_auth_keys_addAdd new key to the client key authorization table. Background: ...
com.nexenta.nms.Appliance::dbus_auth_keys_removeRemove authentication key.

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.7  com.nexenta.nms.Appliance::dbus_auth_keys_list

dictionary {string => string}  dbus_auth_keys_list (void)

Get all authorization keys and their IDs. Background: The appliance provides secure access to other Storage Appliances, as well as administrative management client applications on the network. The inter-appliance access is executed either via SSH, or via SA-API (User Guide, Section "Storage Appliance API"), or both. All management client applications, whether developed internally by Nexenta Systems, Inc and/or by 3rd parties, access appliance via SA-API. In all cases, access to an appliance requires client authentication. SA-API supports two authentication mechanisms: 1) via IP address of the client machine, and 2) via ssh-keygen generated authentication keys. The 2nd, ssh-keygen based, mechanism is the preferred one. This (2nd) mechanism is realized via APIs: com.nexenta.nms.Appliance::dbus_auth_keys_add, com.nexenta.nms.Appliance::dbus_auth_keys_remove, com.nexenta.nms.Appliance::dbus_auth_keys_list. This is the mechanism used by Storage Appliances to communicate between themselves. The latter is required to run storage replication services, to execute in a group mode, to switch between appliances for the purposes of centralized management. Once the appliances are ssh-bound, all SA-API interfaces become available, and get executed in a secure way. Please see User Guide Sections "Centralized Management" and "Secure Access" for more information.

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
dictionary {string => string}Dictionary { string => string }, with key IDs and their values.
See Also
MethodShort Description
com.nexenta.nms.Appliance::dbus_auth_iptable_setDeny or allow access to the appliance from the specified ...
com.nexenta.nms.Appliance::dbus_auth_iptable_listGet all iptable access rules. Background: The appliance provides secure ...
com.nexenta.nms.Appliance::dbus_auth_iptable_unsetRemove deny or allow access rule from the appliance's iptable. ...
com.nexenta.nms.Appliance::dbus_auth_keys_addAdd new key to the client key authorization table. Background: ...
com.nexenta.nms.Appliance::dbus_auth_keys_removeRemove authentication key.

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.8  com.nexenta.nms.Appliance::dbus_auth_keys_remove

void  dbus_auth_keys_remove (string key)

Remove authentication key.

Parameters
NAMETYPEDESCRIPTION
keystringKey identifier.
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Appliance::dbus_auth_iptable_setDeny or allow access to the appliance from the specified ...
com.nexenta.nms.Appliance::dbus_auth_iptable_listGet all iptable access rules. Background: The appliance provides secure ...
com.nexenta.nms.Appliance::dbus_auth_iptable_unsetRemove deny or allow access rule from the appliance's iptable. ...
com.nexenta.nms.Appliance::dbus_auth_keys_addAdd new key to the client key authorization table. Background: ...
com.nexenta.nms.Appliance::dbus_auth_keys_removeRemove authentication key.

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.9  com.nexenta.nms.Appliance::delete_swap

void  delete_swap (string zname)

Remove zvol swap area - undo the effect of com.nexenta.nms.Appliance::add_swap

Parameters
NAMETYPEDESCRIPTION
znamestringZvol pathname, for instance 'vol1/zvol1', where vol1 would be the name of an underlying volume
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Appliance::add_swapAdd zvol as an additional swap area
com.nexenta.nms.Appliance::list_swapGet summary information about total swap space usage, existing swap ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.10  com.nexenta.nms.Appliance::get_cpu_info

dictionary {int32 => dictionary {string => string}}  get_cpu_info (void)

Get detailed per-CPU information

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
dictionary {int32 => dictionary {string => string}}Nested dictionary { cpu_number => { cpu_item => value } }. The inner dictionary here is the per-CPU information containing the following items: 'clock_MHz', 'crtime', 'cpu_type', 'core_id', 'model', 'ncore_per_chip', 'brand', 'state', 'clog_id', 'implementation', 'fpu_type', 'state_begin', 'stepping', 'supported_frequencies_Hz', 'vendor_id', 'pkg_core_id', 'current_clock_Hz', 'ncpu_per_chip', 'chip_id', 'class', 'snaptime', 'family'.
Usage Examples
1.  appliance_if->get_cpu_info() 

Get detailed per-CPU information. A sample output follows: { '0' => { 'clock_MHz' => '2300', 'crtime' => '15.99439196', 'cpu_type' => 'i386', 'core_id' => '0', 'model' => '15', 'ncore_per_chip' => '1', 'brand' => 'Intel(r) Core(tm)2 Duo CPU T7700 @ 2.40GHz', 'state' => 'on-line', 'clog_id' => '0', 'implementation' => 'x86 (GenuineIntel 6F8 family 6 model 15 step 8 clock 2300 MHz)', 'fpu_type' => 'i387 compatible', 'state_begin' => '1213042644', 'stepping' => '8', 'supported_frequencies_Hz' => '2299926901', 'vendor_id' => 'GenuineIntel', 'pkg_core_id' => '0', 'current_clock_Hz' => '2299926901', 'ncpu_per_chip' => '1', 'chip_id' => '0', 'class' => 'misc', 'snaptime' => '54922.184402079', 'family' => '6' } }

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.11  com.nexenta.nms.Appliance::get_etchosts_rec

void  get_etchosts_rec (string pattern)

Given a hostname or a part of a hostname, or FQDN - get the corresponding record from the appliance's local host table. In modern systems host tables have been superseded by DNS. However, the host table is still widely used for small sites isolated from the network. The local host table may also be required by some of the appliance's services, in particular replication and HA cluster services. Please see the corresponding manual pages for details. In addition, if in your environment the local information rarely changes, and the network is not connected to the Internet, DNS offers little advantage. The host table (file '/etc/hosts') - is a simple text file that associates IP addresses with hostnames, one line per IP address. For each host a single line should be present with the following information: IP_address hostname [aliases...]. This API simply retrieves the corresponding record, and presents the result as array of strings, for instance: ('192.168.102.194', 'chost', 'chost.cdomain')

Parameters
NAMETYPEDESCRIPTION
patternstringPattern to select a record from appliance's local host table. The pattern must be specified and cannot be empty string.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  appliance_if->get_etchosts_rec('chost') 

Get 'chost' record from the apliance's local host table. The result may look like: ('192.168.102.194', 'chost', 'chost.cdomain')

See Also
MethodShort Description
com.nexenta.nms.Appliance::set_etchosts_recAdd, replace or delete a record from the appliance's local ...
com.nexenta.nms.Network::set_nameserversSet name servers. Appliance may have up to 3 configured ...
com.nexenta.nms.Network::nameserversGet name servers.

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.12  com.nexenta.nms.Appliance::get_fqdn

string  get_fqdn (void)

Get a fully qualified domain name (FQDN) of the appliance.

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
stringAppliance's FQDN (string).
Usage Examples
1.  appliance_if->get_fqdn() 

Get appliance's FQDN. For example, assuming appliance's local hostname 'myhost' and domain name is 'example.com', the fully qualified domain name would be 'myhost.example.com'.

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.13  com.nexenta.nms.Appliance::get_kbd_layouts

array of (string)  get_kbd_layouts (void)

Get all supported keyboard layouts

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
array of (string)Array of available keyboard layouts
Usage Examples
1.  appliance_if->get_kbd_layouts() 

Get all available keyboard layouts. This may return the following array: (Albanian Belarusian Belgian Bulgarian Croatian Czech Danish Dutch Finnish French French-Canadian Hungarian German Greek Icelandic Italian Japanese-type6 Japanese Korean Latin-American Lithuanian Latvian Macedonian Malta_UK Malta_US Norwegian Polish Portuguese Russian Serbia-And-Montenegro Slovenian Slovakian Spanish Swedish Swiss-French Swiss-German Taiwan)

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.14  com.nexenta.nms.Appliance::get_license_info

dictionary {string => string}  get_license_info (void)

Get license information

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
dictionary {string => string}Dictionary {string => string}, with the following keys: 'license_key', 'license_cntr_used', 'license_type', 'license_message', 'license_days_left', 'license_size_left_percent', 'license_size_total', 'license_size_used', 'license_cntr_max', 'machine_sig', 'license_size_max'. The keys are self-explanatory, for instance, 'license_key' is the license key used to register the appliance, 'license_days_left' is the current number of days left until the license expires, 'license_size_left_percent' is the percentage of storage space that can be deployed without violating the imposed limit (if any), and so on. Note that, while not all keys are relevant for all licenses, the returned information universally contains the same set of keys for all existing license types. For instance, a certain license type may not have any limitation in terms of space, and/or usage time (ie, the license may be perpetual), and or the number of controllers, etc. In all cases, a non-relevant key will have (-1) value. For instance, if your license type does not have expiration date, the returned dictionary will contain { 'license_days_left' => -1 }
Usage Examples
1.  appliance_if->get_license_info() 

Get license information. A sample return follows: { 'license_key' => 'EVAL-E501340681-5D2UD6-BIAHJK', 'license_cntr_used' => '-1', 'license_type' => 'EVAL', 'license_message' => 'Software license verified OK', 'license_days_left' => '-1', 'license_size_left_percent' => '65', 'license_size_used' => '3.2TB', 'license_cntr_max' => '-1', 'machine_sig' => '5D2UD6' }

See Also
MethodShort Description
com.nexenta.nms.Appliance::set_license_keyUpdate license key

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.15  com.nexenta.nms.Appliance::get_memstat

dictionary {string => int32}  get_memstat (void)

Get RAM utilization information

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
dictionary {string => int32}Dictionary { 'ram_total' => value1, 'ram_unusable' => value2, 'ram_kernel' => value3, 'ram_locked' => value4, 'ram_free' => value5, 'ram_paging' => value6, 'ram_used' => value7 }. The 1 through 7 values - all measured in MB (megabytes) - reflect the actual current values of the corresponding RAM utilization parameters, which are: 'ram_total' - total amount of RAM in the appliance, 'ram_unusable' - unusable RAM, 'ram_kernel' - memory allocated by the OS kernel, 'ram_locked' - locked memory, 'ram-free' - free memory available to applications, 'ram-paging' - swapped memory pages, occupying swap area(s), and finally 'ram-used' - memory used by user space applications. Note that 'ram_total' is the sum of all the rest parameters. Note also that 'ram_paging' greater than zero may adversely affect performance and often indicates insufficient RAM in the appliance.
Usage Examples
1.  appliance_if->get_memstat() 

Get RAM information. A sample output follows: { 'ram_total' => 511, 'ram_unusable' => 8, 'ram_kernel' => 326, 'ram_locked' => 0, 'ram_free' => 51, 'ram_paging' => 0, 'ram_used' => 125 }

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.16  com.nexenta.nms.Appliance::get_saved_configurations

array of (string)  get_saved_configurations (void)

Get the list of all available saved configurations.

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
array of (string)A simple linear array of strings containing triplets: (configuration filename, timestamp, and description). The array starts with a filename followed by the corresponding timestamp, followed the description specified via com.nexenta.nms.Appliance::save_configuration API. For instance: ( '1252099979.tar.gz', 'Fri Sep 4 14:32:59 2009', 'prior to creating auto-sync', '1252100931.tar.gz', 'Fri Sep 4 14:48:51 2009', 'auto-tier destroyed', '1252101756.tar.gz', 'Fri Sep 4 15:02:36 2009', 'hostname changed')
Usage Examples
1.  appliance_if->get_saved_configurations() 

Retrieve all available saved configuration filenames and descriptions. The result may look like: ( '1252099979.tar.gz', 'Fri Sep 4 14:32:59 2009', '', '1252100931.tar.gz', 'Fri Sep 4 14:48:51 2009', 'auto-tier destroyed', '1252101756.tar.gz', 'Fri Sep 4 15:02:36 2009', 'hostname changed'). Please note that the result in this example contains 3 triples, each describing a particular saved configuration.

See Also
MethodShort Description
com.nexenta.nms.Appliance::restore_configurations
com.nexenta.nms.Appliance::save_configurationSave appliance's configuration at a pre-defined location. The current location ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.17  com.nexenta.nms.Appliance::get_subtimezones

array of (string)  get_subtimezones (string continent, string country)

Get time zones for the specified country located in the specified continent

Parameters
NAMETYPEDESCRIPTION
continentstringTime zone continent (see com.nexenta.nms.Appliance::get_timezone_continents)
countrystringCountry name
Return Value
TYPEDESCRIPTION
array of (string)Time zone code
Usage Examples
1.  appliance_if->get_subtimezones("America", "Mexico") 

Get time zones for Mexico.

See Also
MethodShort Description
com.nexenta.nms.Appliance::get_timezone_continentGet time zone code for the specified country
com.nexenta.nms.Appliance::get_timezonesGiven a time zone continent, get all its time zones ...
com.nexenta.nms.Appliance::get_subtimezonesGet time zones for the specified country located in the ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.18  com.nexenta.nms.Appliance::get_timezone_continent

string  get_timezone_continent (string timezone)

Get time zone code for the specified country

Parameters
NAMETYPEDESCRIPTION
timezonestringTime zone
Return Value
TYPEDESCRIPTION
stringTime zone continent
Usage Examples
1.  appliance_if->get_timezone_continent("Europe/Prague") 

Translate time zone => continent. The result: "Europe".

See Also
MethodShort Description
com.nexenta.nms.Appliance::get_timezone_continentGet time zone code for the specified country
com.nexenta.nms.Appliance::get_timezonesGiven a time zone continent, get all its time zones ...
com.nexenta.nms.Appliance::get_subtimezonesGet time zones for the specified country located in the ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.19  com.nexenta.nms.Appliance::get_timezone_continents

array of (string)  get_timezone_continents (void)

Get all time zone continents

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
array of (string)Array of all continents
Usage Examples
1.  appliance_if->get_timezone_continents() 

Get names of all time zone continents. The result will be: (Africa America Antarctica Arctic Asia Atlantic Australia Europe Pacific Indian)

See Also
MethodShort Description
com.nexenta.nms.Appliance::get_timezone_country_codeGet time zone code for the specified country
com.nexenta.nms.Appliance::get_timezone_continentGet time zone code for the specified country
com.nexenta.nms.Appliance::get_timezonesGiven a time zone continent, get all its time zones ...
com.nexenta.nms.Appliance::get_subtimezonesGet time zones for the specified country located in the ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.20  com.nexenta.nms.Appliance::get_timezone_country_code

string  get_timezone_country_code (string country)

Get time zone code for the specified country

Parameters
NAMETYPEDESCRIPTION
countrystringCountry name
Return Value
TYPEDESCRIPTION
stringTime zone code
Usage Examples
1.  appliance_if->get_timezone_country_code("Brazil") 

Get time zone code for Brazil. The result: "BR".

See Also
MethodShort Description
com.nexenta.nms.Appliance::get_timezone_continentsGet all time zone continents
com.nexenta.nms.Appliance::get_timezone_continentGet time zone code for the specified country
com.nexenta.nms.Appliance::get_timezonesGiven a time zone continent, get all its time zones ...
com.nexenta.nms.Appliance::get_subtimezonesGet time zones for the specified country located in the ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.21  com.nexenta.nms.Appliance::get_timezones

array of (string)  get_timezones (string continent)

Given a time zone continent, get all its time zones

Parameters
NAMETYPEDESCRIPTION
continentstringTime zone continent (see com.nexenta.nms.Appliance::get_timezone_continents)
Return Value
TYPEDESCRIPTION
array of (string)Time zone code
Usage Examples
1.  appliance_if->get_timezones("Australia") 

Get all time zones for Australia. The result: array that has a single entry: ("Australia").

See Also
MethodShort Description
com.nexenta.nms.Appliance::get_timezone_continentGet time zone code for the specified country
com.nexenta.nms.Appliance::get_timezonesGiven a time zone continent, get all its time zones ...
com.nexenta.nms.Appliance::get_subtimezonesGet time zones for the specified country located in the ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.22  com.nexenta.nms.Appliance::get_uptime

dictionary {string => double}  get_uptime (void)

Get appliance's uptime, including the following information: The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes. The times are measured in seconds from the start of epoch (00:00:00 UTC Jan 1st, 1970)

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
dictionary {string => double}Dictionary { 'boot' => value1, 'time' => value2, 'load1' => value3, 'load5' => value4, 'load15' => value5 }. The value1 here is the actual (up)time the appliance has been running, value2 is the current time, and the rest 3 values specify and the system load averages for the past 1, 5, and 15 minutes.
Usage Examples
1.  appliance_if->get_uptime() 

Get appliance's uptime information. A sample output: { 'boot' => '86400', 'time' => '1213163656', 'load1' => '0.03', 'load5' => '0.03', 'load15' => '0.02' }

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.23  com.nexenta.nms.Appliance::list_appliances

dictionary {string => string}  list_appliances (void)

Get all SSH-bound as well as dynamically discovered on a local subnet appliances that are currently online. The returned dictionary includes those and only those appliances that are currently online from the perspective of the appliance that executes the operation.

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
dictionary {string => string}Dictionary { appliance's hostname => IP address }. Each record in the returned dictionary is a simple (key, value) pair, where the key is remote appliance's hostname, the value - its IPv4 address.
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssh_bindSSH-bind a given (user, appliance) to the specified remote host. ...
com.nexenta.nms.Appliance::ssh_unbindSSH-unbind a given (user, appliance) from the specified remote host. ...
com.nexenta.nms.Appliance::ssh_list_bindingsGet all existing SSH bound hosts
com.nexenta.nms.Appliance::ssh_check_bindingCheck whether the specified appliance's user is SSH-bound to the ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.24  com.nexenta.nms.Appliance::list_swap

array of (string)  list_swap (bool include_hdr_total)

Get summary information about total swap space usage, existing swap areas, and availability

Parameters
NAMETYPEDESCRIPTION
include_hdr_totalboolinclude_hdr_total = 0 | 1. Specifies whether to include detailed per swap area information
Return Value
TYPEDESCRIPTION
array of (string)Array of lines describing, as per swap(1m): allocated - The total amount of swap space in bytes currently allocated for use as backing store; reserved - The total amount of swap space in bytes not currently allocated, but claimed by memory mappings for possible future use; used - The total amount of swap space in bytes that is either allocated or reserved.
See Also
MethodShort Description
com.nexenta.nms.Appliance::add_swapAdd zvol as an additional swap area
com.nexenta.nms.Appliance::delete_swapRemove zvol swap area - undo the effect of com.nexenta.nms.Appliance::add_swap ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.25  com.nexenta.nms.Appliance::ns_getent

array of (string)  ns_getent (string entity, string type, string filter)

Get local and LDAP based users, groups, and netgroups

Parameters
NAMETYPEDESCRIPTION
entitystringentity = 'group' | 'passwd' | 'netgroup'. Respectively: 'group' - retrieve group names, 'passwd' - retrieve user names, 'netgroup' - retrieve netgroups. Note that users and groups can be both local and LDAP defined, while netgroups (groups of computers) can only be added via LDAP directory service.
typestringtype = 'local' | 'ldap' | ''. Use 'local' to retrieve locally defined users or groups, 'ldap' - LDAP defined users or groups, empty string '' - a union of both local and LDAP entities, that is, entities listed in the associated LDAP directory service.
filterstringFilter returned records based on the specified filter string. For instance, for entity 'user' filter = 'jo' will match usernames such as 'john', 'joe', 'joseph', etc. An empty filter '' matches all records.
Return Value
TYPEDESCRIPTION
array of (string)Array of names, for instance ('group_eng', 'group_hr', 'group_mrk')
Usage Examples
1.  appliance_if->ns_getent('group', '', '') 

Get all groups including those listed in the LDAP directory

2.  appliance_if->ns_getent('group', 'local', '') 

Retrieve only local groups

3.  appliance_if->ns_getent('passwd', 'local', '') 

Get all local users

4.  appliance_if->ns_getent('passwd', 'ldap', 'jo') 

Get LDAP users with usernames starting with 'jo'

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_netgroupGet a list of hosts (computers) included in a given ...
com.nexenta.nms.Appliance::ns_user_getGiven a local or LDAP defined user, get properties such ...
com.nexenta.nms.Appliance::ns_user_existsFind out whether a given user exists; if found, the ...
com.nexenta.nms.Appliance::ns_user_setModify existing local user or add new local user, if ...
com.nexenta.nms.Appliance::ns_user_delDelete the specified user
com.nexenta.nms.Appliance::ns_group_setModify existing local group or create a new group, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.26  com.nexenta.nms.Appliance::ns_group_del

void  ns_group_del (string group)

Delete the specified group

Parameters
NAMETYPEDESCRIPTION
groupstringThe name of the group
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  ns_user_del('contractors') 

Delete group 'contractors'

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_group_existsFind out whether a given group exists; if found, the ...
com.nexenta.nms.Appliance::ns_getentGet local and LDAP based users, groups, and netgroups ...
com.nexenta.nms.Appliance::ns_netgroupGet a list of hosts (computers) included in a given ...
com.nexenta.nms.Appliance::ns_user_getGiven a local or LDAP defined user, get properties such ...
com.nexenta.nms.Appliance::ns_user_existsFind out whether a given user exists; if found, the ...
com.nexenta.nms.Appliance::ns_user_delDelete the specified user
com.nexenta.nms.Appliance::ns_user_setModify existing local user or add new local user, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.27  com.nexenta.nms.Appliance::ns_group_exists

string  ns_group_exists (string group)

Find out whether a given group exists; if found, the method returns group type

Parameters
NAMETYPEDESCRIPTION
groupstringThe name of the group
Return Value
TYPEDESCRIPTION
string'' | 'local' | 'ldap'. Returns empty string '' if the group does not exist; otherwise returns the group type 'local' or 'ldap', depending on whether the group is a locally defined appliance's group or listed in the LDAP directory
Usage Examples
1.  appliance_if->ns_group_exists('staff') 

Check if the group 'staff' is defined

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_user_existsFind out whether a given user exists; if found, the ...
com.nexenta.nms.Appliance::ns_getentGet local and LDAP based users, groups, and netgroups ...
com.nexenta.nms.Appliance::ns_netgroupGet a list of hosts (computers) included in a given ...
com.nexenta.nms.Appliance::ns_user_getGiven a local or LDAP defined user, get properties such ...
com.nexenta.nms.Appliance::ns_user_setModify existing local user or add new local user, if ...
com.nexenta.nms.Appliance::ns_user_delDelete the specified user
com.nexenta.nms.Appliance::ns_group_setModify existing local group or create a new group, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.28  com.nexenta.nms.Appliance::ns_group_get

dictionary {string => string}  ns_group_get (string group)

Given a local or LDAP defined group, get properties such as group ID, group members, group type ('local' or 'ldap'). LDAP defined groups may have other properties.

Parameters
NAMETYPEDESCRIPTION
groupstringthe name of the group
Return Value
TYPEDESCRIPTION
dictionary {string => string}Dictionary { string => string }, with keys such as 'type', 'gidNumber', 'memberUid'. The latter specifies a record of group members, for instance: 'john mike alice'. Non-local groups listed in the LDAP directory may have other properties.
Usage Examples
1.  appliance_if->ns_group_get('staff') 

Get properties and members of the group 'staff'. Following is a sample result: { 'type' => 'local', 'gidNumber' => 3001, 'memberUid' => 'john mike alice' }

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_group_existsFind out whether a given group exists; if found, the ...
com.nexenta.nms.Appliance::ns_getentGet local and LDAP based users, groups, and netgroups ...
com.nexenta.nms.Appliance::ns_netgroupGet a list of hosts (computers) included in a given ...
com.nexenta.nms.Appliance::ns_user_getGiven a local or LDAP defined user, get properties such ...
com.nexenta.nms.Appliance::ns_user_existsFind out whether a given user exists; if found, the ...
com.nexenta.nms.Appliance::ns_user_setModify existing local user or add new local user, if ...
com.nexenta.nms.Appliance::ns_group_setModify existing local group or create a new group, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.29  com.nexenta.nms.Appliance::ns_group_idmap_get

string  ns_group_idmap_get (string group)

Get identity mapping for a given Unix group.

Parameters
NAMETYPEDESCRIPTION
groupstringThe name of the group
Return Value
TYPEDESCRIPTION
stringThe mapping (string).
Usage Examples
1.  appliance_if->ns_group_idmap_get('staff') 

Get idmap for group 'staff'. The result may look like: 'wingroup:Staff@corp.com -> unixgroup:staff'

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_group_existsFind out whether a given group exists; if found, the ...
com.nexenta.nms.Appliance::ns_getentGet local and LDAP based users, groups, and netgroups ...
com.nexenta.nms.Appliance::ns_netgroupGet a list of hosts (computers) included in a given ...
com.nexenta.nms.Appliance::ns_user_getGiven a local or LDAP defined user, get properties such ...
com.nexenta.nms.Appliance::ns_user_setModify existing local user or add new local user, if ...
com.nexenta.nms.Appliance::ns_user_delDelete the specified user
com.nexenta.nms.Appliance::ns_group_setModify existing local group or create a new group, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.30  com.nexenta.nms.Appliance::ns_group_set

void  ns_group_set (string group, string type, dictionary {string => string} props)

Modify existing local group or create a new group, if does not exist. The new/existing group properties include: 'gidNumber' (group ID) and 'memberUid' that specifies a space delimited list of group members. The current implementation will work only for locally defined (type = 'local') groups

Parameters
NAMETYPEDESCRIPTION
groupstringThe name of the group
typestringThe type of the group. Must be 'local'.
propsdictionary {string => string}Dictionary { string => string } that contains group properties.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  appliance_if->ns_group_set('staff', 'local', { 'memberUid' => "john mike alice" }) 

Define local group 'staff'

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_group_existsFind out whether a given group exists; if found, the ...
com.nexenta.nms.Appliance::ns_getentGet local and LDAP based users, groups, and netgroups ...
com.nexenta.nms.Appliance::ns_netgroupGet a list of hosts (computers) included in a given ...
com.nexenta.nms.Appliance::ns_user_getGiven a local or LDAP defined user, get properties such ...
com.nexenta.nms.Appliance::ns_user_existsFind out whether a given user exists; if found, the ...
com.nexenta.nms.Appliance::ns_user_delDelete the specified user
com.nexenta.nms.Appliance::ns_user_setModify existing local user or add new local user, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.31  com.nexenta.nms.Appliance::ns_netgroup

array of (string)  ns_netgroup (string netgroup)

Get a list of hosts (computers) included in a given netgroup

Parameters
NAMETYPEDESCRIPTION
netgroupstringThe name of the netgroup
Return Value
TYPEDESCRIPTION
array of (string)Array of hostnames
Usage Examples
1.  appliance_if->ns_netgroup('netgroup-engineering') 

List all hosts from netgroup 'netgroup-engineering'. The result may look like: ('host1.mycorp.com', 'host2.mycorp.com', ...)

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_getentGet local and LDAP based users, groups, and netgroups ...
com.nexenta.nms.Appliance::ns_user_getGiven a local or LDAP defined user, get properties such ...
com.nexenta.nms.Appliance::ns_user_existsFind out whether a given user exists; if found, the ...
com.nexenta.nms.Appliance::ns_user_setModify existing local user or add new local user, if ...
com.nexenta.nms.Appliance::ns_user_delDelete the specified user
com.nexenta.nms.Appliance::ns_group_setModify existing local group or create a new group, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.32  com.nexenta.nms.Appliance::ns_user_del

void  ns_user_del (string user, bool del_home_folder)

Delete the specified user

Parameters
NAMETYPEDESCRIPTION
userstringThe name of the user
del_home_folderbooldel_home_folder = 0 | 1. Specifies whether to delete the user's home folder.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  appliance_if->ns_user_del('john', 1) 

Delete user 'john' and destroy the associated home folder

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_getentGet local and LDAP based users, groups, and netgroups ...
com.nexenta.nms.Appliance::ns_netgroupGet a list of hosts (computers) included in a given ...
com.nexenta.nms.Appliance::ns_user_getGiven a local or LDAP defined user, get properties such ...
com.nexenta.nms.Appliance::ns_user_existsFind out whether a given user exists; if found, the ...
com.nexenta.nms.Appliance::ns_user_setModify existing local user or add new local user, if ...
com.nexenta.nms.Appliance::ns_group_setModify existing local group or create a new group, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.33  com.nexenta.nms.Appliance::ns_user_exists

string  ns_user_exists (string user)

Find out whether a given user exists; if found, the method returns user type

Parameters
NAMETYPEDESCRIPTION
userstringThe name of the user
Return Value
TYPEDESCRIPTION
string'' | 'local' | 'ldap'. Returns empty string '' if the user does not exist; otherwise returns the user type 'local' or 'ldap', depending on whether the user is a locally defined appliance's user or listed in the LDAP directory
Usage Examples
1.  appliance_if->ns_user_exists('john') 

Check if the user 'john' is defined

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_group_existsFind out whether a given group exists; if found, the ...
com.nexenta.nms.Appliance::ns_getentGet local and LDAP based users, groups, and netgroups ...
com.nexenta.nms.Appliance::ns_netgroupGet a list of hosts (computers) included in a given ...
com.nexenta.nms.Appliance::ns_user_getGiven a local or LDAP defined user, get properties such ...
com.nexenta.nms.Appliance::ns_user_setModify existing local user or add new local user, if ...
com.nexenta.nms.Appliance::ns_user_delDelete the specified user
com.nexenta.nms.Appliance::ns_group_setModify existing local group or create a new group, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.34  com.nexenta.nms.Appliance::ns_user_get

dictionary {string => string}  ns_user_get (string user)

Given a local or LDAP defined user, get properties such as user ID (UID), home folder on the appliance, group ID, etc.

Parameters
NAMETYPEDESCRIPTION
userstringThe name of the user
Return Value
TYPEDESCRIPTION
dictionary {string => string}Dictionary {string => string} that contains user properties such as 'type' ('local' or 'ldap'), 'gidNumber' (the user's default group identified by its group ID), 'group' (the user's default group name), 'uidNumber' (the user's ID), 'homeFolder', 'description'. Users listed in the LDAP directory may have other properties defined, such as 'loginShell', 'homeDrive', 'smbHome', and more.
Usage Examples
1.  appliance_if->ns_user_get('smb') 

Return properties for user 'smb'; a sample return follows: { 'user' => 'smb', 'type' => 'local', 'gidNumber' => 1, 'group' => 'other', 'uidNumber' => 1001, 'homeFolder' => '', 'description' => '' }

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_getentGet local and LDAP based users, groups, and netgroups ...
com.nexenta.nms.Appliance::ns_netgroupGet a list of hosts (computers) included in a given ...
com.nexenta.nms.Appliance::ns_user_existsFind out whether a given user exists; if found, the ...
com.nexenta.nms.Appliance::ns_user_setModify existing local user or add new local user, if ...
com.nexenta.nms.Appliance::ns_user_delDelete the specified user
com.nexenta.nms.Appliance::ns_group_setModify existing local group or create a new group, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.35  com.nexenta.nms.Appliance::ns_user_idmap_get

string  ns_user_idmap_get (string user)

Get identity mapping for a given Unix user.

Parameters
NAMETYPEDESCRIPTION
userstringThe name of the user
Return Value
TYPEDESCRIPTION
stringThe mapping (string).
Usage Examples
1.  appliance_if->ns_user_idmap_get('john') 

Get idmap for user 'john'. The result may look like: 'winuser:John@corp.com -> unixuser:john'

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_group_existsFind out whether a given group exists; if found, the ...
com.nexenta.nms.Appliance::ns_getentGet local and LDAP based users, groups, and netgroups ...
com.nexenta.nms.Appliance::ns_netgroupGet a list of hosts (computers) included in a given ...
com.nexenta.nms.Appliance::ns_user_getGiven a local or LDAP defined user, get properties such ...
com.nexenta.nms.Appliance::ns_user_setModify existing local user or add new local user, if ...
com.nexenta.nms.Appliance::ns_user_delDelete the specified user
com.nexenta.nms.Appliance::ns_group_setModify existing local group or create a new group, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.36  com.nexenta.nms.Appliance::ns_user_set

void  ns_user_set (string user, string type, dictionary {string => string} props)

Modify existing local user or add new local user, if the user does not exist. The user properties include: 'uidNumber' (the user's ID), 'gidNumber' (the user's default group ID), 'homeFolder', 'description'. The current implementation will work only for locally defined (type = 'local') users

Parameters
NAMETYPEDESCRIPTION
userstringThe name of the user
typestringThe type of the user. Must be 'local'.
propsdictionary {string => string}Dictionary { string => string } that contains new properties to update existing user or assign to a new user, if does not exist.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  appliance_if->ns_user_set('new_user_x', 'local', { 'uidNumber' => 1020, 'gidNumber' => 75, 'description' => "new description" }) 

Assuming 'new_user_x' does not exist, this will create a new local user definition with the default group ID = 75, etc.

See Also
MethodShort Description
com.nexenta.nms.Appliance::ns_getentGet local and LDAP based users, groups, and netgroups ...
com.nexenta.nms.Appliance::ns_netgroupGet a list of hosts (computers) included in a given ...
com.nexenta.nms.Appliance::ns_user_getGiven a local or LDAP defined user, get properties such ...
com.nexenta.nms.Appliance::ns_user_existsFind out whether a given user exists; if found, the ...
com.nexenta.nms.Appliance::ns_user_delDelete the specified user
com.nexenta.nms.Appliance::ns_group_setModify existing local group or create a new group, if ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.37  com.nexenta.nms.Appliance::poweroff

void  poweroff (bool force, bool reconfigure, string extra_options)

Power off the appliance

Parameters
NAMETYPEDESCRIPTION
forceboolforce = 0 | 1. If true (non-zero), force the poweroff operation even though one or more of appliance services are currently running. The forced operation may interrupt the service(s), with partially completed results that depend on the particular service and other conditions. Use force sparingly. In NMC, run 'show appliance nms locks' command to show outstanding locks taken by the running services.
reconfigureboolreconfigure = 0 | 1. Upon subsequent boot, re-enumerate all devices in the system. When the appliance boots again, and if this options was set to true (non-zero) at poweroff time - cleanup stale device links and re-enumerate all devices. The latter includes: disks, network cards, storage controllers. In some rare cases, when devices were moved in the appliance from place to place, new devices added, or used to replace other devices, there may be a situation when the appliance does not "see" a new device. Use reconfigure option to resolve this.
extra_optionsstringExtra options. A string that is passed as is to the system reboot function. For instance, as per poweroff(1m), "-d" forces a system crash dump. See poweroff(1m) for details.
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Appliance::rebootReboot the appliance

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.38  com.nexenta.nms.Appliance::reboot

void  reboot (bool force, bool reconfigure, string extra_options)

Reboot the appliance

Parameters
NAMETYPEDESCRIPTION
forceboolforce = 0 | 1. If true (non-zero), force the reboot operation even though one or more of appliance services are currently running. The latter will interrupt the service(s), with partially completed results that depend on the service and other conditions. Caution: use force sparingly. In NMC, use 'show appliance nms locks' command to show outstanding locks taken by running services.
reconfigureboolreconfigure = 0 | 1. Upon reboot, re-enumerate all devices in the system. If true (non-zero), cleanup stale device links and re-enumerate all devices, including: disks, network cards, storage controllers. In some rare cases, when devices were moved in the appliance from place to place, new devices added, or used to replace other devices, there may be a situation when the appliance does not "see" a new device. Use reconfigure option to resolve this.
extra_optionsstringExtra options. A string that is passed as is to the system reboot function. For instance, as per reboot(1m), "-d" will force a system crash dump before rebooting. Use the delimiter -- (two hyphens) to separate reboot options from the options to be passed to boot(1m). For instance, "-d -- -v" passes "-d" to reboot (and causes system crash dump), and passes "-v" to boot. See reboot(1m) for details.
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Appliance::poweroffPower off the appliance

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.39  com.nexenta.nms.Appliance::restore_configuration

array of (string)  restore_configuration (string component, bool overwrite_newer, bool check_only)

Restore appliance's configuration from the most recent copy stored at a pre-defined location. The current location in use is defined by NMS property 'saved_configroot'. The operation restores service definitions for the appliance's storage services to the point in time they (the definitions) were saved via com.nexenta.nms.Appliance::save_configuration

Parameters
NAMETYPEDESCRIPTION
componentstringcomponent = basic | mailer | nms | nmc | auto-snap | auto-scrub | auto-sync | auto-tier. Use 'basic' to restore basic appliance settings: hostname, domainname, etc. Use 'mailer' to restore Mailer setting: SMTP server, username, password, etc. Use 'nms' to restore NMS configuration options, 'nmc' - to restore NMC configuration options. The rest component types can be used to restore service definitions for the corresponsing automated (auto-) service.
overwrite_newerbooloverwrite_newer = 0 | 1. An older saved component of appliance's configuration overrides a newer existing one if and only if overwrite_newer = 1
check_onlyboolcheck_only = 0 | 1. Setting check_only = 1 allows to "dry run" the operation without actually making changes.
Return Value
TYPEDESCRIPTION
array of (string)Array of lines, with detailed human-readable information on what's changed, which configuration components were restored, etc. For instance, in the simplest case the return may contain a single item reading "NOTICE: configuration not changed, nothing to restore"
Usage Examples
1.  appliance_if->restore_configuration('auto-sync', 0, 0) 

Restore the latest saved auto-sync configuration; do not override existing newer auto-sync service(s), if any

See Also
MethodShort Description
com.nexenta.nms.Appliance::get_saved_configurationsGet the list of all available saved configurations.
com.nexenta.nms.Appliance::save_configurationSave appliance's configuration at a pre-defined location. The current location ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.40  com.nexenta.nms.Appliance::save_configuration

void  save_configuration (string description)

Save appliance's configuration at a pre-defined location. The current location in use is defined by NMS property 'saved_configroot'. The saved configuration will include service definitions for the appliance's storage services. The saved configuration includes the following components: basic | mailer | nms | nmc | auto-snap | auto-scrub | auto-sync | auto-tier, where 'basic' configuration includes appliance basic settings: hostname, domainname, etc., 'mailer' - SMTP server, username, password, etc., 'nms' - NMS configuration options, 'nmc' - NMC configuration options. The rest component types stand for service definitions of the corresponsing automated (auto-) services. Note that com.nexenta.nms.Appliance::restore_configuration method can be used to later restore only some components of the saved configuration, and not necessarily the entire configuration.

Parameters
NAMETYPEDESCRIPTION
descriptionstringArbitrary string to be saved with the configuration itself. Spaces are permitted. The description can be used to help identify any context related to the operation.
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Appliance::get_saved_configurationsGet the list of all available saved configurations.
com.nexenta.nms.Appliance::restore_configurationRestore appliance's configuration from the most recent copy stored at ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.41  com.nexenta.nms.Appliance::set_etchosts_rec

void  set_etchosts_rec (string ipaddr, array of (string) hostnames)

Add, replace or delete a record from the appliance's local host table. The local host table is first searched by ipaddr (the first argument). If the rest arguments is an empty array, the corresponding located record is removed. Otherwise, if the record is located, it is modified, and alternatively - added. Background: In modern systems host tables have been superseded by DNS. However, the host table is still widely used for small sites isolated from the network. The local host table may also be required by some of the appliance's services, in particular replication and HA cluster services. Please see the corresponding manual pages for details. In addition, if in your environment the local information rarely changes, and the network is not connected to the Internet, DNS offers little advantage. The host table (file '/etc/hosts') - is a simple text file that associates IP addresses with hostnames, one line per IP address. For each host a single line should be present with the following information: IP_address hostname [aliases...].

Parameters
NAMETYPEDESCRIPTION
ipaddrstringIP address of the host to be located in (or to be added to) the local appliance's host table.
hostnamesarray of (string)Array of hostname(s) and possibly FQDN(s) to associate with a given IP address.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  appliance_if->set_etchosts_rec('192.168.102.194', ('chost', 'chost.cdomain')) 

Add a record to resolve hostname to IP address to the apliance's local host table, or - if the record already exists - replace it with the specified information.

See Also
MethodShort Description
com.nexenta.nms.Appliance::get_etchosts_recGiven a hostname or a part of a hostname, or ...
com.nexenta.nms.Network::set_nameserversSet name servers. Appliance may have up to 3 configured ...
com.nexenta.nms.Network::nameserversGet name servers.

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.42  com.nexenta.nms.Appliance::set_license_key

bool  set_license_key (string new_license_key)

Update license key

Parameters
NAMETYPEDESCRIPTION
new_license_keystringNew license key
Return Value
TYPEDESCRIPTION
bool0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8. The enumerated return codes are: 0 - success, 1 - appliance not registered, 2 - time expired, 3 - bad or invalid license key (hash), 4 - bad or invalid license key (timestamp), 5 - bad or invalid license key (machine signature), 6 - exceeded used storage space limit, 7 - bad or invalid key, 8 - exceeded maximum number of controllers
Usage Examples
1.  appliance_if->set_license_key('EVAL-E501340681-5D2UD6-BIAHJK') 

Update appliance's license key with a new (license key) value

See Also
MethodShort Description
com.nexenta.nms.Appliance::get_license_infoGet license information

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.43  com.nexenta.nms.Appliance::ssh_bind

void  ssh_bind (string user, string hostport, string password)

SSH-bind a given (user, appliance) to the specified remote host. Two appliances are considered SSH-bound if ssh_bind operation is successfully performed for (and by) 'root'.

Parameters
NAMETYPEDESCRIPTION
userstringUser name. Applaince's local user, or a user registered with the associated LDAP/AD server.
hostportstringhostport = hostname[:port]. The default port is 22. If the ':port' part of the hostport parameter is omitted, the default port 22 is assumed.
passwordstringThe password of the specified user on the remote host.
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssh_check_bindingCheck whether the specified appliance's user is SSH-bound to the ...
com.nexenta.nms.Appliance::ssh_unbindSSH-unbind a given (user, appliance) from the specified remote host. ...
com.nexenta.nms.Appliance::ssh_list_bindingsGet all existing SSH bound hosts
com.nexenta.nms.Appliance::list_appliancesGet all SSH-bound as well as dynamically discovered on a ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.44  com.nexenta.nms.Appliance::ssh_check_binding

bool  ssh_check_binding (string user, string hostport)

Check whether the specified appliance's user is SSH-bound to the specified remote host. Two appliances are considered SSH-bound if ssh_check_binding returns true for user 'root'.

Parameters
NAMETYPEDESCRIPTION
userstringUser name. Applaince's local user, or a user registered with the associated LDAP/AD server.
hostportstringhostport = hostname[:port]. The default port is 22. If the ':port' part of the hostport parameter is omitted, the default port 22 is assumed.
Return Value
TYPEDESCRIPTION
boolTrue (non-zero) - the appliance's user is SSH-bound to the specified host. Zero (that is, false) - the appliance's user is not currently SSH-bound to the specified host.
Usage Examples
1.  appliance_if->ssh_check_binding('root', 'remote-host.domain') 

Check whether the appliance is SSH-bound to 'remote-host.domain'.

2.  appliance_if->ssh_check_binding('mike', '192.168.17.145:4000') 

Check whether the user 'mike' is SSH-bound to host with IP address 192.168.17.145 via the explicitly specified port 4000.

See Also
MethodShort Description
com.nexenta.nms.Appliance::ssh_bindSSH-bind a given (user, appliance) to the specified remote host. ...
com.nexenta.nms.Appliance::ssh_unbindSSH-unbind a given (user, appliance) from the specified remote host. ...
com.nexenta.nms.Appliance::ssh_list_bindingsGet all existing SSH bound hosts
com.nexenta.nms.Appliance::list_appliancesGet all SSH-bound as well as dynamically discovered on a ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.45  com.nexenta.nms.Appliance::ssh_list_bindings

dictionary {string => array of (string)}  ssh_list_bindings (void)

Get all existing SSH bound hosts

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
dictionary {string => array of (string)}Dictionary { hostport => (pingable, ssh-accessible) }. For each SSH-bound host, the dictionary contains an array of two boolean values: pingable = 0 | 1, and ssh-accessible = 0 | 1. The value of 'pingable' is true if and only if there is a basic connnectivity between the appliance and the remote host. The latter 'ssh-accessible' value is set to 1 (true) if the corresponding SSH-bound host is currently accessible over SSH.
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssh_bindSSH-bind a given (user, appliance) to the specified remote host. ...
com.nexenta.nms.Appliance::ssh_unbindSSH-unbind a given (user, appliance) from the specified remote host. ...
com.nexenta.nms.Appliance::ssh_check_bindingCheck whether the specified appliance's user is SSH-bound to the ...
com.nexenta.nms.Appliance::list_appliancesGet all SSH-bound as well as dynamically discovered on a ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.46  com.nexenta.nms.Appliance::ssh_unbind

void  ssh_unbind (string user, string hostport, bool force)

SSH-unbind a given (user, appliance) from the specified remote host. Two appliances are considered SSH-bound if ssh_bind operation is successfully performed for (and by) 'root'. This operation reverses the effect of com.nexenta.nms.Appliance::ssh_bind

Parameters
NAMETYPEDESCRIPTION
userstringUser name. Applaince's local user, or a user registered with the associated LDAP/AD server.
hostportstringhostport = hostname[:port]. The default port is 22. If the ':port' part of the hostport parameter is omitted, the default port 22 is assumed.
forceboolforce = 0 | 1. Non-zero (true) - force the operation even though the remote may not be accessible.
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssh_bindSSH-bind a given (user, appliance) to the specified remote host. ...
com.nexenta.nms.Appliance::ssh_check_bindingCheck whether the specified appliance's user is SSH-bound to the ...
com.nexenta.nms.Appliance::ssh_list_bindingsGet all existing SSH bound hosts
com.nexenta.nms.Appliance::list_appliancesGet all SSH-bound as well as dynamically discovered on a ...

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.47  com.nexenta.nms.Appliance::ssl_bind

int32  ssl_bind (string certificate, string cname)

Add a new certificate to LDAP managed database

Parameters
NAMETYPEDESCRIPTION
certificatestringCertificate file
cnamestringCertificate alias (optional): cname = '' means that FQDN will be used.
Return Value
TYPEDESCRIPTION
int32Return code = 0 | retcode. Returns zero on success, non-zero on failure
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssl_direct_bindAdd a new certificate to LDAP managed database
com.nexenta.nms.Appliance::ssl_check_bindingCheck whether the specified certificate exists in database
com.nexenta.nms.Appliance::ssl_unbind com.nexenta.nms.Appliance::ssl_unbind_by_hostname
com.nexenta.nms.Appliance::ssl_list_bindingsGet trusted host information for all existing certificates
com.nexenta.nms.Appliance::ssl_list_certinfosGet certificate information for all existing certificates

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.48  com.nexenta.nms.Appliance::ssl_check_binding

bool  ssl_check_binding (string cname)

Check whether the specified certificate exists in database

Parameters
NAMETYPEDESCRIPTION
cnamestringCertificate alias
Return Value
TYPEDESCRIPTION
boolNon-zero (true) - certificate exists in the database; 0 (false) - certificate does not exist
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssl_direct_bindAdd a new certificate to LDAP managed database
com.nexenta.nms.Appliance::ssl_bindAdd a new certificate to LDAP managed database
com.nexenta.nms.Appliance::ssl_unbind com.nexenta.nms.Appliance::ssl_unbind_by_hostname
com.nexenta.nms.Appliance::ssl_list_bindingsGet trusted host information for all existing certificates
com.nexenta.nms.Appliance::ssl_list_certinfosGet certificate information for all existing certificates

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.49  com.nexenta.nms.Appliance::ssl_direct_bind

int32  ssl_direct_bind (string hostport, string cname)

Add a new certificate to LDAP managed database

Parameters
NAMETYPEDESCRIPTION
hostportstringhostport = hostname[:port]. The default port is 636. If the ':port' part of the hostport parameter is omitted, the default port 636 is assumed.
cnamestringCertificate alias (optional): cname = '' (empty string) means that FQDN will be used.
Return Value
TYPEDESCRIPTION
int32Retcode = 0 | retcode. Returns zero on success, non-zero on failure
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssl_check_bindingCheck whether the specified certificate exists in database
com.nexenta.nms.Appliance::ssl_bindAdd a new certificate to LDAP managed database
com.nexenta.nms.Appliance::ssl_unbind com.nexenta.nms.Appliance::ssl_unbind_by_hostname
com.nexenta.nms.Appliance::ssl_list_bindingsGet trusted host information for all existing certificates
com.nexenta.nms.Appliance::ssl_list_certinfosGet certificate information for all existing certificates

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.50  com.nexenta.nms.Appliance::ssl_list_bindings

dictionary {string => string}  ssl_list_bindings (void)

Get trusted host information for all existing certificates

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
dictionary {string => string}Dictionary { alias => hostname }, where alias is the certicate's alias (cname), and hostname is a trusted host name.
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssl_direct_bindAdd a new certificate to LDAP managed database
com.nexenta.nms.Appliance::ssl_check_bindingCheck whether the specified certificate exists in database
com.nexenta.nms.Appliance::ssl_bind com.nexenta.nms.Appliance::ssl_unbind
com.nexenta.nms.Appliance::ssl_unbind_by_hostnameRemove certificate from the LDAP managed database
com.nexenta.nms.Appliance::ssl_list_certinfosGet certificate information for all existing certificates

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.51  com.nexenta.nms.Appliance::ssl_list_certificates

array of (string)  ssl_list_certificates (void)

Get certificate files

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
array of (string)Array of certificate files. Each certificate file in this returned array is a single string that is a join of all lines from an original certificate file. To state the same differently, each certificate file is converted to a lengthy string before transferring it to the requesting client.
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssl_direct_bindAdd a new certificate to LDAP managed database
com.nexenta.nms.Appliance::ssl_check_bindingCheck whether the specified certificate exists in database
com.nexenta.nms.Appliance::ssl_bind com.nexenta.nms.Appliance::ssl_unbind
com.nexenta.nms.Appliance::ssl_unbind_by_hostnameRemove certificate from the LDAP managed database
com.nexenta.nms.Appliance::ssl_list_bindingsGet trusted host information for all existing certificates

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.52  com.nexenta.nms.Appliance::ssl_list_certinfos

array of (dictionary {string => string})  ssl_list_certinfos (void)

Get certificate information for all existing certificates

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
array of (dictionary {string => string})Array of dictionaries: a dictionary per certificate. Each item in the returned array is a dictionary with the following keys: { alias => alias_value, hostname => hostname_value, issuer => issuer_name_value, serial => serial_value, startdate => startdate_value, enddate => enddate_value }.
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssl_direct_bindAdd a new certificate to LDAP managed database
com.nexenta.nms.Appliance::ssl_check_bindingCheck whether the specified certificate exists in database
com.nexenta.nms.Appliance::ssl_bind com.nexenta.nms.Appliance::ssl_unbind
com.nexenta.nms.Appliance::ssl_unbind_by_hostnameRemove certificate from the LDAP managed database
com.nexenta.nms.Appliance::ssl_list_bindingsGet trusted host information for all existing certificates

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.53  com.nexenta.nms.Appliance::ssl_unbind

int32  ssl_unbind (string cname)

Remove the specified certificate from database - compare with com.nexenta.nms.Appliance::ssl_unbind_by_hostname

Parameters
NAMETYPEDESCRIPTION
cnamestringCertificate alias (optional): cname = '' (empty string) means that FQDN will be used.
Return Value
TYPEDESCRIPTION
int32Return code = 0 | 1. Returns zero on success, non-zero on failure to remove the specified certificate from the database, for instance if the certificate cannot be located
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssl_direct_bindAdd a new certificate to LDAP managed database
com.nexenta.nms.Appliance::ssl_check_bindingCheck whether the specified certificate exists in database
com.nexenta.nms.Appliance::ssl_bind com.nexenta.nms.Appliance::ssl_unbind_by_hostname
com.nexenta.nms.Appliance::ssl_list_bindingsGet trusted host information for all existing certificates
com.nexenta.nms.Appliance::ssl_list_certinfosGet certificate information for all existing certificates

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.54  com.nexenta.nms.Appliance::ssl_unbind_by_hostname

int32  ssl_unbind_by_hostname (string host_fqdn)

Remove certificate from the LDAP managed database

Parameters
NAMETYPEDESCRIPTION
host_fqdnstringFQDN of the trusted host
Return Value
TYPEDESCRIPTION
int32Return code = 0 | 1. Returns zero on success, non-zero on failure to remove the specified certificate from the database, for instance if the certificate cannot be located
See Also
MethodShort Description
com.nexenta.nms.Appliance::ssl_direct_bindAdd a new certificate to LDAP managed database
com.nexenta.nms.Appliance::ssl_check_bindingCheck whether the specified certificate exists in database
com.nexenta.nms.Appliance::ssl_bind com.nexenta.nms.Appliance::ssl_unbind
com.nexenta.nms.Appliance::ssl_list_bindingsGet trusted host information for all existing certificates
com.nexenta.nms.Appliance::ssl_list_certinfosGet certificate information for all existing certificates

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

8.55  com.nexenta.nms.Appliance::upgrade_check

int32  upgrade_check (bool invalidate)

Check for appliance software upgrades

Parameters
NAMETYPEDESCRIPTION
invalidateboolinvalidate = 0 | 1. If true (that is, non-zero), disregard locally cached upgrade status and actually perform query on the remote centralized software repository. The latter operation may take some time, use invalidate to get just in time upgrade information. Note that the appliance automatically checks for upgrades and caches the results for a certain time to optimize the operation.
Return Value
TYPEDESCRIPTION
int32-1 | 0 | 1. Returns (-1) on error, which could indicate that the repository is unavailable or in maintenance. Otherwise, 0 indiciates no upgrades available, 1 - upgrades available.
Usage Examples
1.  appliance_if->upgrade_check(0) 

Check for upgrades; use the latest cached result of the automatically performed check for upgrades.

Previous Section: Virtual ContainerTable Of ContentsNext Section: Groups of Appliances Management

9  Groups of Appliances Management

SA-API Interface Object

D-Bus name Interface class name Inherits
/Root/ApplGroupcom.nexenta.nms.ApplGroupVirtual Container
Properties
NAMEDESCRIPTION
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
nameThe name of the object
Inherited Methods
NAMEPROTOTYPE
com.nexenta.nms.Container::get_child_propstring  get_child_prop (string child_name, string propname)
com.nexenta.nms.Container::get_child_propsdictionary {string => string}  get_child_props (string child_name, string pattern)
com.nexenta.nms.Container::get_namesarray of (string)  get_names (string pattern)
com.nexenta.nms.Container::get_names_by_proparray of (string)  get_names_by_prop (string propname, string propval_pattern, string childname_pattern)
com.nexenta.nms.Object::get_propstring  get_prop (string propname)
com.nexenta.nms.Object::get_propsdictionary {string => string}  get_props (string pattern)
com.nexenta.nms.Container::object_existsbool  object_exists (string child_name)
com.nexenta.nms.Container::set_child_propvoid  set_child_prop (string child_name, string propname, string propvalue)
com.nexenta.nms.Object::set_propvoid  set_prop (string propname, string value)
com.nexenta.nms.Container::trylockbool  trylock (string child_name, int32 lock_type)
com.nexenta.nms.Container::unlockvoid  unlock (string child_name, int32 lock_type)

9.1  com.nexenta.nms.ApplGroup::create

void  create (string group_name, dictionary {string => string} group_desc, array of (string) group_members)

Create a new group of two or more appliances. To form a group, make sure there is network connectivity to remote appliances, and/or run com.nexenta.nms.Appliance::ssh_bind to create new ssh-binding(s).

Parameters
NAMETYPEDESCRIPTION
group_namestringThe name of the group
group_descdictionary {string => string}Group description. The parameter is a simple dictionary { string => string }, for instance: { 'description' => 'storage 1 group' }
group_membersarray of (string)Group members. An array of appliances' hostnames or IP addresses, for instance: ('thost.mycorp.com', 'zhost.mycorp.com')
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  applgroup_if->create('storage_1', {'description' => 'storage 1 group'}, ('thost.mycorp.com', 'zhost.mycorp.com')) 

Group the two specified appliances ina group, and name this group 'storage_1'

See Also
MethodShort Description
com.nexenta.nms.ApplGroup::get_group_typesReturns array of supported group types, for instance ['basic'] ...
com.nexenta.nms.ApplGroup::get_membersFor a given group, get its member appliances
com.nexenta.nms.ApplGroup::destroyDestroy the specified group of appliances. This is an opposite ...

Previous Section: General Appliance ManagementTable Of ContentsNext Section: Virtual Runner

9.2  com.nexenta.nms.ApplGroup::destroy

void  destroy (string group_name, bool)

Destroy the specified group of appliances. This is an opposite of com.nexenta.nms.ApplGroup::create, to remove the definition of the specified group.

Parameters
NAMETYPEDESCRIPTION
group_namestringThe name of the group
param_2boolTBD
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.ApplGroup::get_group_typesReturns array of supported group types, for instance ['basic'] ...
com.nexenta.nms.ApplGroup::get_membersFor a given group, get its member appliances
com.nexenta.nms.ApplGroup::destroyDestroy the specified group of appliances. This is an opposite ...

Previous Section: General Appliance ManagementTable Of ContentsNext Section: Virtual Runner

9.3  com.nexenta.nms.ApplGroup::get_group_types

void  get_group_types (void)

Returns array of supported group types, for instance ['basic']

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.ApplGroup::createCreate a new group of two or more appliances. To ...
com.nexenta.nms.ApplGroup::get_membersFor a given group, get its member appliances
com.nexenta.nms.ApplGroup::destroyDestroy the specified group of appliances. This is an opposite ...

Previous Section: General Appliance ManagementTable Of ContentsNext Section: Virtual Runner

9.4  com.nexenta.nms.ApplGroup::get_members

array of (string)  get_members (string group_name)

For a given group, get its member appliances

Parameters
NAMETYPEDESCRIPTION
group_namestringThe name of the group
Return Value
TYPEDESCRIPTION
array of (string)Returns an array of appliances, members of the specified group. Each appliance member is represented by its hostname, for instance: ('thost.corp.com', 'zhost.corp.com').
Usage Examples
1.  applgroup_if->get_members('storage_1') 

Get members of the group 'storage_1'. The result may look like: ('thost.mycorp.com', 'zhost.mycorp.com')

See Also
MethodShort Description
com.nexenta.nms.ApplGroup::get_group_typesReturns array of supported group types, for instance ['basic'] ...
com.nexenta.nms.ApplGroup::get_membersFor a given group, get its member appliances
com.nexenta.nms.ApplGroup::destroyDestroy the specified group of appliances. This is an opposite ...

Previous Section: General Appliance ManagementTable Of ContentsNext Section: Virtual Runner

10  Virtual Runner

SA-API Interface Object

D-Bus name Interface class name Inherits
/Root/Runnercom.nexenta.nms.RunnerVirtual Container
Properties
NAMEDESCRIPTION
flagsflags = none = 0 | is_daemon = 1 | maintenance_on_max_fail = 2 | clear_old_faults = 4 | notify_on_first_fail = 8 | notify_never = 16 | schedule_never = 32 | schedule_later = 64. This creation time property defines the runner's behavior and is a bitwise combination of the listed enumerated values. For instance, flags = 3 indicates that the runner is a daemon and secondly, that when the maximum number of failures is reached, the runner will change its state to maintenance. Names of the specific enumerated values are self-explanatory, for instance, (flags & schedule_never) would mean that the corresponding runner does not run periodicially but instead gets executed via alternative mechanisms
freq_dayThe numeric value depends on the freq_type property. For the freq_type = 'weekly', the day of the week freq_day = 0 | 1 | 2 | 3 | 4 | 5 | 6. Days of the week are numbered as follows: 0 - 'Sun', 1 - 'Mon', 2 - 'Tue', 3 - 'Wed', 4 - 'Thu', 5 - 'Fri', 6 - 'Sat'. For the freq_type = 'monthly', the day of the month freq_day = 1 .. 31
freq_hourfreq_hour = 0 .. 23. Specifies the hour of a day. For instance, freq_hour = 1 specifies 1am.
freq_minutefreq_minute = 0 .. 59. Specifies the minute of an hour. For instance, freq_minute = 30 specifies 30 minutes past a given hour.
freq_periodfreq_period = [1, max]. The maximum value depends on the freq_type. For instance, if the freq_type is 'hourly', the freq_period may have any value in the range [1, 23], and if freq_type is 'monthly', the valid range would be [1, 11], etc.
freq_typefreq_type = 'minute' | 'hourly' | 'daily' | 'weekly' | 'monthly'. The period of execution is set in the units of freq_type. For instance, freq_type = 'hourly' would allow to schedule the runner every 1, or 2, .. or 23 hours. See related com.nexenta.nms.Runner::freq_period
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
nameThe name of the object
periodHuman-readable description of the periodic runner's execution. This description effectively consolidates freq_type, freq_day and the rest frequency related properties into single human-readable string, for instance: "every two hours", "every Saturday at 3am", "every 3rd of each month at 12:45am", etc.
statestate = 'unknown' | 'ready' | 'running' | 'starting' | 'pending' | 'missing'. Normally, a runner would either be 'ready' to execute, or 'running'
statusstatus = 'not-registered' | 'disabled' | 'enabled' | 'maintenance'.
trace_leveltrace_level = none = 0 | default = 1 | verbose = 10 | verbose-verbose = 20 | verbose-verbose-verbose. Specifies various levels of logging verbosity by the runner, from 0 (none) to the most detailed.
typetype = 'trigger' | 'collector' | 'reporter' | 'indexer'
Inherited Methods
NAMEPROTOTYPE
com.nexenta.nms.Container::destroyvoid  destroy (string child_name)
com.nexenta.nms.Container::get_child_propstring  get_child_prop (string child_name, string propname)
com.nexenta.nms.Container::get_child_propsdictionary {string => string}  get_child_props (string child_name, string pattern)
com.nexenta.nms.Container::get_namesarray of (string)  get_names (string pattern)
com.nexenta.nms.Container::get_names_by_proparray of (string)  get_names_by_prop (string propname, string propval_pattern, string childname_pattern)
com.nexenta.nms.Object::get_propstring  get_prop (string propname)
com.nexenta.nms.Object::get_propsdictionary {string => string}  get_props (string pattern)
com.nexenta.nms.Container::object_existsbool  object_exists (string child_name)
com.nexenta.nms.Container::set_child_propvoid  set_child_prop (string child_name, string propname, string propvalue)
com.nexenta.nms.Object::set_propvoid  set_prop (string propname, string value)
com.nexenta.nms.Container::trylockbool  trylock (string child_name, int32 lock_type)
com.nexenta.nms.Container::unlockvoid  unlock (string child_name, int32 lock_type)

10.1  com.nexenta.nms.Runner::disable

void  disable (string runner_name)

Disable the specified runner, ie stop (suspend) its execution. The runner must be registered (see com.nexenta.nms.Runner::register); otherwise this interface method will through an exception.

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the runner dentifying a concrete instance of a fault trigger, collector, reporter, or indexer
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  enable('volume-collector') 

Disable 'volume-collector'

See Also
MethodShort Description
com.nexenta.nms.Runner::enableEnable the specified runner. The runner must be registered (see ...
com.nexenta.nms.Runner::registerRegister the specified runner. The operation validates runner's parameters and ...
com.nexenta.nms.Runner::is_registeredCheck whether the specified runner is registered with the appliance. ...

Previous Section: Groups of Appliances ManagementTable Of ContentsNext Section: Fault Management

10.2  com.nexenta.nms.Runner::enable

void  enable (string runner_name)

Enable the specified runner. The runner must be registered (see com.nexenta.nms.Runner::register); otherwise this interface method will through an exception. If the runner was disabled (see com.nexenta.nms.Runner::disable), this operation effectively results in the runner resuming its execution.

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the runner dentifying a concrete instance of a fault trigger, collector, reporter, or indexer
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  runner_if->enable('runners-check') 

Enable 'runners-check'

See Also
MethodShort Description
com.nexenta.nms.Runner::disableDisable the specified runner, ie stop (suspend) its execution. The ...
com.nexenta.nms.Runner::registerRegister the specified runner. The operation validates runner's parameters and ...
com.nexenta.nms.Runner::is_registeredCheck whether the specified runner is registered with the appliance. ...
com.nexenta.nms.Runner::executeExecute the specified runner. The operation allows to run the ...

Previous Section: Groups of Appliances ManagementTable Of ContentsNext Section: Fault Management

10.3  com.nexenta.nms.Runner::execute

void  execute (string runner_name)

Execute the specified runner. The operation allows to run the runner on-demand, without waiting for its scheduled execution time. The runner must be registered (see com.nexenta.nms.Runner::register); otherwise this interface method will through an exception. Note that the runner may not necessarily be enabled; it is allowed to execute a disabled (suspended) runner.

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the runner dentifying a concrete instance of a fault trigger, collector, reporter, or indexer
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  runner_if->execute('services-check') 

Execute 'services-check'

See Also
MethodShort Description
com.nexenta.nms.Runner::enableEnable the specified runner. The runner must be registered (see ...
com.nexenta.nms.Runner::registerRegister the specified runner. The operation validates runner's parameters and ...
com.nexenta.nms.Runner::is_registeredCheck whether the specified runner is registered with the appliance. ...

Previous Section: Groups of Appliances ManagementTable Of ContentsNext Section: Fault Management

10.4  com.nexenta.nms.Runner::get_tunables

dictionary {string => string}  get_tunables (string runner_name, string pattern, bool exclude_description)

Get the runner's tunables and their descriptions. For defintion of the term "runner", see Terms and Conventions. For the list of concrete "runners" that inherit Virtual Runner, please refer to Section Object Model

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the runner dentifying a concrete instance of a fault trigger, collector, reporter, or indexer
patternstringPattern to select a matching subset of tunables. An empty string will match all runner's tunables
exclude_descriptionboolexclude_description = 0 | 1. If true, will retrieve only the tunables' names without descriptions
Return Value
TYPEDESCRIPTION
dictionary {string => string}Dictionary { string => string } of the runner's tunable properties and their values.
Usage Examples
1.  runner_if->get_tunables('memory-check', '', 0) 

Retrieve all 'memory-check' tunables and their descriptions. The result will include the following: { 'free_swap_critical' => '10', 'paging_critical_shortdesc' => 'Critically high paging intensity threshold (percentage)', 'paging_critical' => '10', 'paging_critical_longdesc' => 'Alarm (severity=critical) is raised if the intensity of paging to disk (scan rate) gets beyond this critical threshold', 'num_procs' => '5', 'free_ram_notice_shortdesc' => 'Free memory low threshold (percentage of total RAM)', 'max_rss_suspect_shortdesc' => 'Maximum resident set size (RSS) of any process in the system (megabytes)', 'enable_swap_check' => '1', ... }

2.  runner_if->get_tunables('memory-check', 'free', 1) 

Get 'memory-check' tunables that contain 'free' in their names, and do not retrieve their descriptions. The result follows: { 'free_swap_critical' => '10', 'free_ram_notice' => '5', 'free_swap_notice' => '25' }

See Also
MethodShort Description
com.nexenta.nms.Runner::set_tunableModify the runner's (tunable) property value. A given runner may ...
com.nexenta.nms.Runner::enableEnable the specified runner. The runner must be registered (see ...
com.nexenta.nms.Runner::registerRegister the specified runner. The operation validates runner's parameters and ...
com.nexenta.nms.Runner::is_registeredCheck whether the specified runner is registered with the appliance. ...

Previous Section: Groups of Appliances ManagementTable Of ContentsNext Section: Fault Management

10.5  com.nexenta.nms.Runner::is_registered

bool  is_registered (string runner_name)

Check whether the specified runner is registered with the appliance. For defintion of the term "runner", see Terms and Conventions.

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the runner dentifying a concrete instance of a fault trigger, collector, reporter, or indexer
Return Value
TYPEDESCRIPTION
bool0 | 1. Returns true if the runner is registered, false otherwise.
Usage Examples
1.  runner_if->is_registered('services-check') 

Find out whether the 'services-check' fault trigger is registered

See Also
MethodShort Description
com.nexenta.nms.Runner::unregisterUnregister the specified runner. The operation reverses the effect of ...
com.nexenta.nms.Runner::registerRegister the specified runner. The operation validates runner's parameters and ...

Previous Section: Groups of Appliances ManagementTable Of ContentsNext Section: Fault Management

10.6  com.nexenta.nms.Runner::register

void  register (string runner_name, dictionary {string => string} params, dictionary {string => string} tunables)

Register the specified runner. The operation validates runner's parameters and registers the runner in the appliance's database. The runner will not execute until it is registered. For defintion of the term "runner", see Terms and Conventions. For the list of concrete "runners" that inherit Virtual Runner, please refer to Section Object Model

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the runner dentifying a concrete instance of a fault trigger, collector, reporter, or indexer
paramsdictionary {string => string}Dictionary { string => string } of the standard properties. The standard properties have well-known names, including: 'type' = 'trigger' | 'collector' | 'reporter' | 'indexer', 'description', flags, 'freq_type' = 'minute' | 'hourly' | 'daily' | 'weekly' | 'monthly', 'freq_period'. For instance, the following registers a fault trigger that executes every two hours: { type => 'trigger', description => 'some description', flags => 2, freq_type => 'hourly', freq_period => 2 }
tunablesdictionary {string => string}Dictionary { string => string } of optional parameters a. k. a. tunables. The tunables are runner-specific and unlike standard properties (above), can have any names. Note that appliance's management clients use SA-API to configure all runner parameters, including the tunables, at runtime. See related com.nexenta.nms.Container::set_child_prop - to modify the standard runner's properties, and com.nexenta.nms.Runner::set_tunable - to modify the tunables
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  runner_if->register('network-util-weekly', { 'type' => 'reporter', 'description' => "Weekly networking report", 'freq_type' => 'weekly', 'freq_day' => 6, 'freq_hour' => 2, 'freq_period' => 1}, {} ) 

Register weekly reporter to execute every Saturday at 2am

See Also
MethodShort Description
com.nexenta.nms.Runner::unregisterUnregister the specified runner. The operation reverses the effect of ...
com.nexenta.nms.Runner::is_registeredCheck whether the specified runner is registered with the appliance. ...
com.nexenta.nms.Runner::disableDisable the specified runner, ie stop (suspend) its execution. The ...
com.nexenta.nms.Runner::enableEnable the specified runner. The runner must be registered (see ...
com.nexenta.nms.Runner::set_tunableModify the runner's (tunable) property value. A given runner may ...

Previous Section: Groups of Appliances ManagementTable Of ContentsNext Section: Fault Management

10.7  com.nexenta.nms.Runner::set_tunable

void  set_tunable (string runner_name, string propname, string propval)

Modify the runner's (tunable) property value. A given runner may have two types of properties: standard properties with well-known names (for instance, 'type', 'description'), and tunables. The latter are runner-specific and can have any names. Use the generic com.nexenta.nms.Container::set_child_prop - to modify the standard runner's properties, and com.nexenta.nms.Runner::set_tunable - to modify the tunables

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the runner dentifying a concrete instance of a fault trigger, collector, reporter, or indexer
propnamestringProperty name
propvalstringProperty value
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  runner_if->set_tunable('memory-check', 'paging_critical', 5) 

Modify the 'memory-check' tunable called 'paging_critical'. The operation in this case would set a new threshold for the paging intensity. To view all runner's tunables and their descriptions, use com.nexenta.nms.Runner::get_tunables

See Also
MethodShort Description
com.nexenta.nms.Runner::get_tunablesGet the runner's tunables and their descriptions. For defintion of ...
com.nexenta.nms.Runner::enableEnable the specified runner. The runner must be registered (see ...
com.nexenta.nms.Runner::registerRegister the specified runner. The operation validates runner's parameters and ...
com.nexenta.nms.Runner::is_registeredCheck whether the specified runner is registered with the appliance. ...

Previous Section: Groups of Appliances ManagementTable Of ContentsNext Section: Fault Management

10.8  com.nexenta.nms.Runner::unregister

void  unregister (string runner_name)

Unregister the specified runner. The operation reverses the effect of com.nexenta.nms.Runner::register - it destroys the active runner instance and remove the corresponding record from the registration database. Note that, once unregistered, the runner cannot be enabled; to simply stop the runner from executing, use com.nexenta.nms.Runner::disable

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the runner dentifying a concrete instance of a fault trigger, collector, reporter, or indexer
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  runner_if->unregister('memory-check') 

Unregister 'memory-check'

See Also
MethodShort Description
com.nexenta.nms.Runner::registerRegister the specified runner. The operation validates runner's parameters and ...
com.nexenta.nms.Runner::is_registeredCheck whether the specified runner is registered with the appliance. ...
com.nexenta.nms.Runner::enableEnable the specified runner. The runner must be registered (see ...
com.nexenta.nms.Runner::disableDisable the specified runner, ie stop (suspend) its execution. The ...

Previous Section: Groups of Appliances ManagementTable Of ContentsNext Section: Fault Management

11  Fault Management

SA-API Interface Object

D-Bus name Interface class name Inherits
/Root/Runner/Triggercom.nexenta.nms.TriggerVirtual Runner
Properties
NAMEDESCRIPTION
flagsflags = none = 0 | is_daemon = 1 | maintenance_on_max_fail = 2 | clear_old_faults = 4 | notify_on_first_fail = 8 | notify_never = 16 | schedule_never = 32 | schedule_later = 64. This creation time property defines the runner's behavior and is a bitwise combination of the listed enumerated values. For instance, flags = 3 indicates that the runner is a daemon and secondly, that when the maximum number of failures is reached, the runner will change its state to maintenance. Names of the specific enumerated values are self-explanatory, for instance, (flags & schedule_never) would mean that the corresponding runner does not run periodicially but instead gets executed via alternative mechanisms
freq_dayThe numeric value depends on the freq_type property. For the freq_type = 'weekly', the day of the week freq_day = 0 | 1 | 2 | 3 | 4 | 5 | 6. Days of the week are numbered as follows: 0 - 'Sun', 1 - 'Mon', 2 - 'Tue', 3 - 'Wed', 4 - 'Thu', 5 - 'Fri', 6 - 'Sat'. For the freq_type = 'monthly', the day of the month freq_day = 1 .. 31
freq_hourfreq_hour = 0 .. 23. Specifies the hour of a day. For instance, freq_hour = 1 specifies 1am.
freq_minutefreq_minute = 0 .. 59. Specifies the minute of an hour. For instance, freq_minute = 30 specifies 30 minutes past a given hour.
freq_periodfreq_period = [1, max]. The maximum value depends on the freq_type. For instance, if the freq_type is 'hourly', the freq_period may have any value in the range [1, 23], and if freq_type is 'monthly', the valid range would be [1, 11], etc.
freq_typefreq_type = 'minute' | 'hourly' | 'daily' | 'weekly' | 'monthly'. The period of execution is set in the units of freq_type. For instance, freq_type = 'hourly' would allow to schedule the runner every 1, or 2, .. or 23 hours. See related com.nexenta.nms.Runner::freq_period
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
keep_dayskeep_days = number of days. Unless explicitly specified, the system default value is used, which is: 60 days. Specifies number of days to keep the runner's generated persistent information. For a fault trigger, the generated faults are erased from the database after keep_days. Similarly, statistics collector's generated records older than keep_days are removed as well.
nameThe name of the object
periodHuman-readable description of the periodic runner's execution. This description effectively consolidates freq_type, freq_day and the rest frequency related properties into single human-readable string, for instance: "every two hours", "every Saturday at 3am", "every 3rd of each month at 12:45am", etc.
statestate = 'unknown' | 'ready' | 'running' | 'starting' | 'pending' | 'missing'. Normally, a runner would either be 'ready' to execute, or 'running'
statusstatus = 'not-registered' | 'disabled' | 'enabled' | 'maintenance'.
trace_leveltrace_level = none = 0 | default = 1 | verbose = 10 | verbose-verbose = 20 | verbose-verbose-verbose. Specifies various levels of logging verbosity by the runner, from 0 (none) to the most detailed.
typetype = 'trigger' | 'collector' | 'reporter' | 'indexer'
Inherited Methods
NAMEPROTOTYPE
com.nexenta.nms.Container::destroyvoid  destroy (string child_name)
com.nexenta.nms.Runner::disablevoid  disable (string runner_name)
com.nexenta.nms.Runner::enablevoid  enable (string runner_name)
com.nexenta.nms.Runner::executevoid  execute (string runner_name)
com.nexenta.nms.Container::get_child_propstring  get_child_prop (string child_name, string propname)
com.nexenta.nms.Container::get_child_propsdictionary {string => string}  get_child_props (string child_name, string pattern)
com.nexenta.nms.Container::get_namesarray of (string)  get_names (string pattern)
com.nexenta.nms.Container::get_names_by_proparray of (string)  get_names_by_prop (string propname, string propval_pattern, string childname_pattern)
com.nexenta.nms.Object::get_propstring  get_prop (string propname)
com.nexenta.nms.Object::get_propsdictionary {string => string}  get_props (string pattern)
com.nexenta.nms.Runner::get_tunablesdictionary {string => string}  get_tunables (string runner_name, string pattern, bool exclude_description)
com.nexenta.nms.Runner::is_registeredbool  is_registered (string runner_name)
com.nexenta.nms.Container::object_existsbool  object_exists (string child_name)
com.nexenta.nms.Runner::registervoid  register (string runner_name, dictionary {string => string} params, dictionary {string => string} tunables)
com.nexenta.nms.Container::set_child_propvoid  set_child_prop (string child_name, string propname, string propvalue)
com.nexenta.nms.Object::set_propvoid  set_prop (string propname, string value)
com.nexenta.nms.Runner::set_tunablevoid  set_tunable (string runner_name, string propname, string propval)
com.nexenta.nms.Container::trylockbool  trylock (string child_name, int32 lock_type)
com.nexenta.nms.Container::unlockvoid  unlock (string child_name, int32 lock_type)
com.nexenta.nms.Runner::unregistervoid  unregister (string runner_name)

11.1  com.nexenta.nms.Trigger::clear

void  clear (string runner_name, int32 fault_id)

Clear specific fault ID

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the fault trigger
fault_idint32Fault ID
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  trigger_if->clear('memory-check', 2) 

Clear fault ID = 2 raized by the 'memory-check'

See Also
MethodShort Description
com.nexenta.nms.Trigger::clear_allClear all faults generated by the specified fault trigger ...
com.nexenta.nms.Trigger::get_faultsGet faults generated so far by the specified fault trigger; ...
com.nexenta.nms.Trigger::faultGenerate fault notification

Previous Section: Virtual RunnerTable Of ContentsNext Section: Statistics Collection

11.2  com.nexenta.nms.Trigger::clear_all

void  clear_all (string runner_name)

Clear all faults generated by the specified fault trigger

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the fault trigger
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  trigger_if->clear_all('memory-check') 

Clear all faults raised so far by the 'memory-check'

See Also
MethodShort Description
com.nexenta.nms.Trigger::clearClear specific fault ID
com.nexenta.nms.Trigger::get_faultsGet faults generated so far by the specified fault trigger; ...
com.nexenta.nms.Trigger::faultGenerate fault notification

Previous Section: Virtual RunnerTable Of ContentsNext Section: Statistics Collection

11.3  com.nexenta.nms.Trigger::fault

void  fault (string runner_name, dictionary {string => string} params)

Generate fault notification

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the fault trigger
paramsdictionary {string => string}dictionary { string => string } that contains the following keys: 'id', 'level', 'severity', 'max_fail', 'description', 'details'. And the values are: 'id' = , 'level' = 'ALARM' | 'FATAL' | 'ERROR', 'severity' = 'CRITICAL' | 'NOTICE', 'max_fail' = , 'description' = , 'details' = . For instance: { 'id' => 10032, 'level' => 'ALARM', 'max_fail' => 1, 'severity' => 'CRITICAL', 'description' => "Out of memory", 'details' => "..." }
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  trigger_if->fault('memory-check', { 'id' => 8, 'level' => 'ALARM', 'max_fail' => 1, 'severity' => 'CRITICAL', 'description' => "Out of memory", 'details' => "..." } ) 

Generate alarm-level fault notification with the specified parameters

See Also
MethodShort Description
com.nexenta.nms.Trigger::get_faultsGet faults generated so far by the specified fault trigger; ...
com.nexenta.nms.Trigger::clearClear specific fault ID
com.nexenta.nms.Trigger::clear_allClear all faults generated by the specified fault trigger ...

Previous Section: Virtual RunnerTable Of ContentsNext Section: Statistics Collection

11.4  com.nexenta.nms.Trigger::get_faults

dictionary {int32 => dictionary {string => string}}  get_faults (string runner_name)

Get faults generated so far by the specified fault trigger; the resulting dictionary includes detailed fault descriptions

Parameters
NAMETYPEDESCRIPTION
runner_namestringThe name of the fault trigger
Return Value
TYPEDESCRIPTION
dictionary {int32 => dictionary {string => string}}nested dictionary { fault_id => dictionary { string => string } }, per each unique fault generated by the specified fault trigger. The inner dictionary includes the following keys: 'id', 'count', 'severity', 'timestamp', 'description', 'details'. In general, the inner dictionary exactly corresponds to the parameters of the fault as described in com.nexenta.nms.Trigger::fault
Usage Examples
1.  trigger_if->get_faults('memory-check') 

Get faults by 'memory-check'

See Also
MethodShort Description
com.nexenta.nms.Trigger::faultGenerate fault notification
com.nexenta.nms.Trigger::clearClear specific fault ID
com.nexenta.nms.Trigger::clear_allClear all faults generated by the specified fault trigger ...
com.nexenta.nms.Trigger::faultGenerate fault notification

Previous Section: Virtual RunnerTable Of ContentsNext Section: Statistics Collection

12  Statistics Collection

SA-API Interface Object

D-Bus name Interface class name Inherits
/Root/Runner/Collectorcom.nexenta.nms.CollectorVirtual Runner
Properties
NAMEDESCRIPTION
flagsflags = none = 0 | is_daemon = 1 | maintenance_on_max_fail = 2 | clear_old_faults = 4 | notify_on_first_fail = 8 | notify_never = 16 | schedule_never = 32 | schedule_later = 64. This creation time property defines the runner's behavior and is a bitwise combination of the listed enumerated values. For instance, flags = 3 indicates that the runner is a daemon and secondly, that when the maximum number of failures is reached, the runner will change its state to maintenance. Names of the specific enumerated values are self-explanatory, for instance, (flags & schedule_never) would mean that the corresponding runner does not run periodicially but instead gets executed via alternative mechanisms
freq_dayThe numeric value depends on the freq_type property. For the freq_type = 'weekly', the day of the week freq_day = 0 | 1 | 2 | 3 | 4 | 5 | 6. Days of the week are numbered as follows: 0 - 'Sun', 1 - 'Mon', 2 - 'Tue', 3 - 'Wed', 4 - 'Thu', 5 - 'Fri', 6 - 'Sat'. For the freq_type = 'monthly', the day of the month freq_day = 1 .. 31
freq_hourfreq_hour = 0 .. 23. Specifies the hour of a day. For instance, freq_hour = 1 specifies 1am.
freq_minutefreq_minute = 0 .. 59. Specifies the minute of an hour. For instance, freq_minute = 30 specifies 30 minutes past a given hour.
freq_periodfreq_period = [1, max]. The maximum value depends on the freq_type. For instance, if the freq_type is 'hourly', the freq_period may have any value in the range [1, 23], and if freq_type is 'monthly', the valid range would be [1, 11], etc.
freq_typefreq_type = 'minute' | 'hourly' | 'daily' | 'weekly' | 'monthly'. The period of execution is set in the units of freq_type. For instance, freq_type = 'hourly' would allow to schedule the runner every 1, or 2, .. or 23 hours. See related com.nexenta.nms.Runner::freq_period
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
keep_dayskeep_days = number of days. Unless explicitly specified, the system default value is used, which is: 60 days. Specifies number of days to keep the runner's generated persistent information. For a fault trigger, the generated faults are erased from the database after keep_days. Similarly, statistics collector's generated records older than keep_days are removed as well.
nameThe name of the object
periodHuman-readable description of the periodic runner's execution. This description effectively consolidates freq_type, freq_day and the rest frequency related properties into single human-readable string, for instance: "every two hours", "every Saturday at 3am", "every 3rd of each month at 12:45am", etc.
statestate = 'unknown' | 'ready' | 'running' | 'starting' | 'pending' | 'missing'. Normally, a runner would either be 'ready' to execute, or 'running'
statusstatus = 'not-registered' | 'disabled' | 'enabled' | 'maintenance'.
trace_leveltrace_level = none = 0 | default = 1 | verbose = 10 | verbose-verbose = 20 | verbose-verbose-verbose. Specifies various levels of logging verbosity by the runner, from 0 (none) to the most detailed.
typetype = 'trigger' | 'collector' | 'reporter' | 'indexer'

13  Reporting Facility (Services, Performance, Capacity)

SA-API Interface Object

D-Bus name Interface class name Inherits
/Root/Runner/Reportercom.nexenta.nms.ReporterVirtual Runner
Properties
NAMEDESCRIPTION
flagsflags = none = 0 | is_daemon = 1 | maintenance_on_max_fail = 2 | clear_old_faults = 4 | notify_on_first_fail = 8 | notify_never = 16 | schedule_never = 32 | schedule_later = 64. This creation time property defines the runner's behavior and is a bitwise combination of the listed enumerated values. For instance, flags = 3 indicates that the runner is a daemon and secondly, that when the maximum number of failures is reached, the runner will change its state to maintenance. Names of the specific enumerated values are self-explanatory, for instance, (flags & schedule_never) would mean that the corresponding runner does not run periodicially but instead gets executed via alternative mechanisms
freq_dayThe numeric value depends on the freq_type property. For the freq_type = 'weekly', the day of the week freq_day = 0 | 1 | 2 | 3 | 4 | 5 | 6. Days of the week are numbered as follows: 0 - 'Sun', 1 - 'Mon', 2 - 'Tue', 3 - 'Wed', 4 - 'Thu', 5 - 'Fri', 6 - 'Sat'. For the freq_type = 'monthly', the day of the month freq_day = 1 .. 31
freq_hourfreq_hour = 0 .. 23. Specifies the hour of a day. For instance, freq_hour = 1 specifies 1am.
freq_minutefreq_minute = 0 .. 59. Specifies the minute of an hour. For instance, freq_minute = 30 specifies 30 minutes past a given hour.
freq_periodfreq_period = [1, max]. The maximum value depends on the freq_type. For instance, if the freq_type is 'hourly', the freq_period may have any value in the range [1, 23], and if freq_type is 'monthly', the valid range would be [1, 11], etc.
freq_typefreq_type = 'minute' | 'hourly' | 'daily' | 'weekly' | 'monthly'. The period of execution is set in the units of freq_type. For instance, freq_type = 'hourly' would allow to schedule the runner every 1, or 2, .. or 23 hours. See related com.nexenta.nms.Runner::freq_period
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
nameThe name of the object
periodHuman-readable description of the periodic runner's execution. This description effectively consolidates freq_type, freq_day and the rest frequency related properties into single human-readable string, for instance: "every two hours", "every Saturday at 3am", "every 3rd of each month at 12:45am", etc.
statestate = 'unknown' | 'ready' | 'running' | 'starting' | 'pending' | 'missing'. Normally, a runner would either be 'ready' to execute, or 'running'
statusstatus = 'not-registered' | 'disabled' | 'enabled' | 'maintenance'.
trace_leveltrace_level = none = 0 | default = 1 | verbose = 10 | verbose-verbose = 20 | verbose-verbose-verbose. Specifies various levels of logging verbosity by the runner, from 0 (none) to the most detailed.
typetype = 'trigger' | 'collector' | 'reporter' | 'indexer'

14  Folder and Snapshot Indexing Facility (Search Engine)

SA-API Interface Object

D-Bus name Interface class name Inherits
/Root/Runner/Indexercom.nexenta.nms.IndexerVirtual Runner
Properties
NAMEDESCRIPTION
dbfolderSpecifies location of the indexing database. By default, the generated indexing data is kept on the system volume ('syspool'), in a folder named 'syspool/.index/escaped_name'. Here the escaped_name is produced based on the name of the folder that is being indexed, as explained below. For instance, for an indexer that indexes a folder 'vol1/a/b', the generated indexing database is stored by default in the corresponding system folder named 'syspool/.index/vol1-a-b'. Notice the correspondence between the original folder name 'vol1/a/b' and dbfolder 'syspool/.index/vol1-a-b'. See also com.nexenta.nms.Indexer::escaped_name.
escaped_nameThe property is deruved from the name of the folder that is being indexed and searched, with all forward '/' replaced with dash '-'. For instance, for an indexer that indexes a folder 'vol1/a/b', the escaped name will be 'vol1-a-b'.
flagsflags = none = 0 | is_daemon = 1 | maintenance_on_max_fail = 2 | clear_old_faults = 4 | notify_on_first_fail = 8 | notify_never = 16 | schedule_never = 32 | schedule_later = 64. This creation time property defines the runner's behavior and is a bitwise combination of the listed enumerated values. For instance, flags = 3 indicates that the runner is a daemon and secondly, that when the maximum number of failures is reached, the runner will change its state to maintenance. Names of the specific enumerated values are self-explanatory, for instance, (flags & schedule_never) would mean that the corresponding runner does not run periodicially but instead gets executed via alternative mechanisms
freq_dayThe numeric value depends on the freq_type property. For the freq_type = 'weekly', the day of the week freq_day = 0 | 1 | 2 | 3 | 4 | 5 | 6. Days of the week are numbered as follows: 0 - 'Sun', 1 - 'Mon', 2 - 'Tue', 3 - 'Wed', 4 - 'Thu', 5 - 'Fri', 6 - 'Sat'. For the freq_type = 'monthly', the day of the month freq_day = 1 .. 31
freq_hourfreq_hour = 0 .. 23. Specifies the hour of a day. For instance, freq_hour = 1 specifies 1am.
freq_minutefreq_minute = 0 .. 59. Specifies the minute of an hour. For instance, freq_minute = 30 specifies 30 minutes past a given hour.
freq_periodfreq_period = [1, max]. The maximum value depends on the freq_type. For instance, if the freq_type is 'hourly', the freq_period may have any value in the range [1, 23], and if freq_type is 'monthly', the valid range would be [1, 11], etc.
freq_typefreq_type = 'minute' | 'hourly' | 'daily' | 'weekly' | 'monthly'. The period of execution is set in the units of freq_type. For instance, freq_type = 'hourly' would allow to schedule the runner every 1, or 2, .. or 23 hours. See related com.nexenta.nms.Runner::freq_period
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
nameThe name of the object
periodHuman-readable description of the periodic runner's execution. This description effectively consolidates freq_type, freq_day and the rest frequency related properties into single human-readable string, for instance: "every two hours", "every Saturday at 3am", "every 3rd of each month at 12:45am", etc.
statestate = 'unknown' | 'ready' | 'running' | 'starting' | 'pending' | 'missing'. Normally, a runner would either be 'ready' to execute, or 'running'
statusstatus = 'not-registered' | 'disabled' | 'enabled' | 'maintenance'.
trace_leveltrace_level = none = 0 | default = 1 | verbose = 10 | verbose-verbose = 20 | verbose-verbose-verbose. Specifies various levels of logging verbosity by the runner, from 0 (none) to the most detailed.
typetype = 'trigger' | 'collector' | 'reporter' | 'indexer'
Inherited Methods
NAMEPROTOTYPE
com.nexenta.nms.Runner::disablevoid  disable (string runner_name)
com.nexenta.nms.Runner::enablevoid  enable (string runner_name)
com.nexenta.nms.Runner::executevoid  execute (string runner_name)
com.nexenta.nms.Container::get_child_propstring  get_child_prop (string child_name, string propname)
com.nexenta.nms.Container::get_child_propsdictionary {string => string}  get_child_props (string child_name, string pattern)
com.nexenta.nms.Container::get_namesarray of (string)  get_names (string pattern)
com.nexenta.nms.Container::get_names_by_proparray of (string)  get_names_by_prop (string propname, string propval_pattern, string childname_pattern)
com.nexenta.nms.Object::get_propstring  get_prop (string propname)
com.nexenta.nms.Object::get_propsdictionary {string => string}  get_props (string pattern)
com.nexenta.nms.Runner::get_tunablesdictionary {string => string}  get_tunables (string runner_name, string pattern, bool exclude_description)
com.nexenta.nms.Runner::is_registeredbool  is_registered (string runner_name)
com.nexenta.nms.Container::object_existsbool  object_exists (string child_name)
com.nexenta.nms.Runner::registervoid  register (string runner_name, dictionary {string => string} params, dictionary {string => string} tunables)
com.nexenta.nms.Container::set_child_propvoid  set_child_prop (string child_name, string propname, string propvalue)
com.nexenta.nms.Object::set_propvoid  set_prop (string propname, string value)
com.nexenta.nms.Runner::set_tunablevoid  set_tunable (string runner_name, string propname, string propval)
com.nexenta.nms.Container::trylockbool  trylock (string child_name, int32 lock_type)
com.nexenta.nms.Container::unlockvoid  unlock (string child_name, int32 lock_type)
com.nexenta.nms.Runner::unregistervoid  unregister (string runner_name)

14.1  com.nexenta.nms.Indexer::create

void  create (string zname)

Create indexer for the specified folder. Once created, the indexer may be registered via inherited com.nexenta.nms.Runner::register method, and then it will start executing at a specified interval of times. In general, being a concrete instance of Virtual Runner, an indexer may be registered and unregistered, enabled and disabled (suspended), etc. Note that once the indexer gets registered and starts running, it will be indexing the specified folder (see the first argument) and recursively its mounted sub-folders. For the list of all "runners" that inherit Virtual Runner, please refer to Section Object Model

Parameters
NAMETYPEDESCRIPTION
znamestringThe name of the folder to index. Note that this name is the name of the created indexer, used in all the rest SA-API methods to identify the indexer instance.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  indexer_if->create('vol1/a/b') 

Create an indexer to index folder 'vol1/a/b' and its mounted sub-folders (if any). Subsequently, the method com.nexenta.nms.Indexer::search can be used to search this folder and its snapshots, for instance com.nexenta.nms.Indexer::search('vol1/a/b', { 'terms' => ..., 'operation' => ... } ) will search the folder for certain specified terms/keywords, etc.

See Also
MethodShort Description
com.nexenta.nms.Indexer::destroyDestroy the specified indexer
com.nexenta.nms.Indexer::set_indexinfo
com.nexenta.nms.Runner::registerRegister the specified runner. The operation validates runner's parameters and ...
com.nexenta.nms.Runner::is_registeredCheck whether the specified runner is registered with the appliance. ...
com.nexenta.nms.Indexer::searchSearch the folder and its snapshot(s).
com.nexenta.nms.Runner::enableEnable the specified runner. The runner must be registered (see ...
com.nexenta.nms.Runner::executeExecute the specified runner. The operation allows to run the ...

Previous Section: Reporting Facility (Services, Performance, Capacity)Table Of ContentsNext Section: Logical and Physical Disk Management

14.2  com.nexenta.nms.Indexer::destroy

void  destroy (string zname)

Destroy the specified indexer

Parameters
NAMETYPEDESCRIPTION
znamestringThe name of the folder that is being indexed. The name of the folder that is being indexed is effectively the name of the indexer itself. To destroy an indexer, use the folder that was specified in the corresponding com.nexenta.nms.Indexer::create method to create this indexer instance.
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Indexer::createCreate indexer for the specified folder. Once created, the indexer ...
com.nexenta.nms.Runner::unregisterUnregister the specified runner. The operation reverses the effect of ...
com.nexenta.nms.Runner::is_registeredCheck whether the specified runner is registered with the appliance. ...
com.nexenta.nms.Runner::disableDisable the specified runner, ie stop (suspend) its execution. The ...
com.nexenta.nms.Runner::executeExecute the specified runner. The operation allows to run the ...

Previous Section: Reporting Facility (Services, Performance, Capacity)Table Of ContentsNext Section: Logical and Physical Disk Management

14.3  com.nexenta.nms.Indexer::search

void  search (string zname, dictionary {string => string} request)

Search the folder and its snapshot(s).

Parameters
NAMETYPEDESCRIPTION
znamestringThe name of the folder
requestdictionary {string => string}Dictionary { string => string }, with a single mandatory key: 'terms', and the following optional keys: 'operation', 'paginate_min', 'paginate_max', 'snapshot'.
Return Value
TYPEDESCRIPTION
voidNone
See Also
MethodShort Description
com.nexenta.nms.Indexer::createCreate indexer for the specified folder. Once created, the indexer ...
com.nexenta.nms.Runner::unregisterUnregister the specified runner. The operation reverses the effect of ...
com.nexenta.nms.Runner::is_registeredCheck whether the specified runner is registered with the appliance. ...
com.nexenta.nms.Runner::disableDisable the specified runner, ie stop (suspend) its execution. The ...
com.nexenta.nms.Runner::executeExecute the specified runner. The operation allows to run the ...

Previous Section: Reporting Facility (Services, Performance, Capacity)Table Of ContentsNext Section: Logical and Physical Disk Management

15  Logical and Physical Disk Management

SA-API Interface Object

D-Bus name Interface class name Inherits
/Root/Luncom.nexenta.nms.LunVirtual Container
Properties
NAMEDESCRIPTION
blinkingTBD
caching_supportedTBD
ddi_parentTBD
device_idSystem-level device ID, for instance 'id1,sd@f0000000047f07e6d0003c10f0000'. Internal use only.
device_typeTBD
driverTBD
driver_instanceTBD
guidTBD
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
media_presentTBD
modelDevice model. Device hardware model, if the LUN is a physical disk, for instance ST320414A would indicate one of the Seagate drives, WD7500AAKS - one of the Western Digital models, etc.
mountpointTBD
nameThe name of the object
productTBD
removableremovable = 'yes' | 'no'. The value of the property is 'yes' for USB attached devices and CD-ROMs. Otherwise it is 'no'.
revisionDevice revision, for instance '1.0'.
sizeThe size of the LUN, for instance: "498GB", "1TB", "80GB".
size_bytesThe LUN size, in bytes (integer value). For instance, 1073741824 - for 1TB drive.
size_strTBD
slot_idTBD
subtypesubtype = 'sas' | 'sata' | 'scsi' | 'zvol'. The subtype property allows to differentiate between various SCSI-compliant devices.
vendorDevice vendor. Hardware vendor, in case of a physical disk. For VMware's .VMDK virtual disks this property will have a value 'VMware'.
Inherited Methods
NAMEPROTOTYPE
com.nexenta.nms.Container::destroyvoid  destroy (string child_name)
com.nexenta.nms.Container::get_child_propstring  get_child_prop (string child_name, string propname)
com.nexenta.nms.Container::get_child_propsdictionary {string => string}  get_child_props (string child_name, string pattern)
com.nexenta.nms.Container::get_namesarray of (string)  get_names (string pattern)
com.nexenta.nms.Container::get_names_by_proparray of (string)  get_names_by_prop (string propname, string propval_pattern, string childname_pattern)
com.nexenta.nms.Object::get_propstring  get_prop (string propname)
com.nexenta.nms.Object::get_propsdictionary {string => string}  get_props (string pattern)
com.nexenta.nms.Container::object_existsbool  object_exists (string child_name)
com.nexenta.nms.Container::set_child_propvoid  set_child_prop (string child_name, string propname, string propvalue)
com.nexenta.nms.Object::set_propvoid  set_prop (string propname, string value)
com.nexenta.nms.Container::trylockbool  trylock (string child_name, int32 lock_type)
com.nexenta.nms.Container::unlockvoid  unlock (string child_name, int32 lock_type)

15.1  com.nexenta.nms.Lun::cache

string  cache (string disk_name, string cache_type, string action)

Retrieve, enable and disable on-disk read and write cache. The method allows to get, or change (enable or disable) write-cache and/or read-cache on the device. This functionality is restricted only to those drives that provide on-device caches and support SCSI compliant way to enable and disable them.

Parameters
NAMETYPEDESCRIPTION
disk_namestringThe name of the physical or virtual disk (LUN). For instance: 'c5t3d0' or 'c0d1' (the latter for IDE).
cache_typestringcache_type = write_cache | read_cache. The paramemeter can have one of the following string values: "write_cache" - to get the current setting or enable/disable write-cache on the device, or "read_cache" - to get the current setting or enable/disable read-cache
actionstringaction = display | enable | disable. Use "display" to simply retrieve the current setting. Use "enable" to enable the specified cache on the specified device. Finally, use "disable" to disable the specified cache on the specified device.
Return Value
TYPEDESCRIPTION
stringThe current cache setting, which may be one of the following: "enabled" | "disabledi" | "unsupported". The latter value indicates that the device does not support the corresponding functionality.
Usage Examples
1.  lun_if->cache('c1t2d0', 'write_cache', 'disable') 

Disable write-cache on the 'c1t2d0'

2.  lun_if->cache('c3t4d0', 'write_cache', 'display') 

Get the current write-cache setting of the 'c1t2d0'.

Previous Section: Folder and Snapshot Indexing Facility (Search Engine)Table Of ContentsNext Section: Volume (Pool)

15.2  com.nexenta.nms.Lun::disk_is_avail

bool  disk_is_avail (string disk_name)

Determine whether the specified disk (LUN) is available for usage, and in particular, to create new appliance's volumes. Thisinterface method checks a number of conditions, including availability of all disk slices (see com.nexenta.nms.Lun::slice_is_avail), existence of storage services such as auto-cdp that are using the disk, whether or not the disk is already used by one of the appliance's volumes, whether the disk is used as a swap area, and more.

Parameters
NAMETYPEDESCRIPTION
disk_namestringThe name of the physical or virtual disk (LUN). For instance: 'c5t3d0' or 'c0d1' (the latter for IDE).
Return Value
TYPEDESCRIPTION
boolTrue (non-zero) - the specified physical or virtual disk is available. Zero (that is, false) - the specified disk is unavailable.
Usage Examples
1.  lun_if->disk_is_avail('c5t3d0') 

Find out whether the specified disk is unallocated and available for using it to create a new volume, or grow or attach to an existing volume.

See Also
MethodShort Description
com.nexenta.nms.Lun::slice_is_avail
com.nexenta.nms.Volume::vol_growGrow a volume
com.nexenta.nms.Volume::vol_createCreate a volume
com.nexenta.nms.Volume::attach_lunAttach to an existing mirror if the mirror containing ...

Previous Section: Folder and Snapshot Indexing Facility (Search Engine)Table Of ContentsNext Section: Volume (Pool)

15.3  com.nexenta.nms.Lun::lunsync

void  lunsync (bool cleanup)

Resynchronize appliance's LUNs. Re-enumerates devices in the appliance. This interface method is particularly useful in extremely rare cases when (and if) the system does not discover newly attached LUNs (physical or logical disk drives) automatically.

Parameters
NAMETYPEDESCRIPTION
cleanupboolcleanup = 0 | 1. If true (non-zero), cleanup obsolete (dangling) device links
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  lun_if->lunsync(1) 

Re-enumerate devices in the appliance and cleanup dangling device links

Previous Section: Folder and Snapshot Indexing Facility (Search Engine)Table Of ContentsNext Section: Volume (Pool)

15.4  com.nexenta.nms.Lun::mounted_disks

array of (string)  mounted_disks (void)

Get all mounted disks. The disk is considered mounted if it has any mounted slices.

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
array of (string)Array of all mounted disks, for instance: ('c0t0d0', 'c0t1d0')
Usage Examples
1.  lun_if->mounted_disks() 

Get all mounted physical and virtual disks (LUNs).

See Also
MethodShort Description
com.nexenta.nms.Lun::slice_is_avail
com.nexenta.nms.Lun::disk_is_availDetermine whether the specified disk (LUN) is available for usage, ...
com.nexenta.nms.Volume::vol_growGrow a volume
com.nexenta.nms.Volume::vol_createCreate a volume
com.nexenta.nms.Volume::attach_lunAttach to an existing mirror if the mirror containing ...

Previous Section: Folder and Snapshot Indexing Facility (Search Engine)Table Of ContentsNext Section: Volume (Pool)

16  Volume (Pool)

SA-API Interface Object

D-Bus name Interface class name Inherits
/Root/Volumecom.nexenta.nms.VolumeVirtual Container
Properties
NAMEDESCRIPTION
autoreplacezpool(1m): autoreplace = on | off. Controls automatic device replacement. If set to "off", device replacement must be initiated by the administrator by using the "zpool replace" command. If set to "on", any new device, found in the same physical location as a device that previously belonged to the pool, is automatically formatted and replaced. The default behavior is "off".
availableAvailable storage space within the volume. Or, same: amount of storage that can be used.
bootfsRead-only property that specifies the default bootable dataset for the system volume
cachefileThis property allows to store the volume's configuration in a non-default location, which may be useful in some environments such as clustering. Advanced usage only.
capacityPercentage total volume space used. Roughly: (used * 100 / size)
failmodefailmode = wait | continue | panic. The default value is "wait". This property specifies the behavior in the event of catastrophic failure resulting from failure of some/all devices in the volume. By default ("wait"), all I/O access is blocked until the failed device(s) are recovered and errors cleared. Setting this property to "continue" allows read operations to any remaining healthy devices in the volume. Finally, the "panic" value causes generation of system crash dump.
healthThe volume's health. The property may have one of the following 6 enumerated values: "ONLINE", "DEGRADED", "FAULTED", "OFFLINE", "REMOVED", "UNAVAIL"
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
nameThe name of the object
sizeTotal size of the volume
usedUsed storage space, the size of storage within the volume occupied by data
versionThe current on-disk ZFS version of the volume
Inherited Methods
NAMEPROTOTYPE
com.nexenta.nms.Container::get_child_propstring  get_child_prop (string child_name, string propname)
com.nexenta.nms.Container::get_child_propsdictionary {string => string}  get_child_props (string child_name, string pattern)
com.nexenta.nms.Container::get_names_by_proparray of (string)  get_names_by_prop (string propname, string propval_pattern, string childname_pattern)
com.nexenta.nms.Object::get_propstring  get_prop (string propname)
com.nexenta.nms.Object::get_propsdictionary {string => string}  get_props (string pattern)
com.nexenta.nms.Container::object_existsbool  object_exists (string child_name)
com.nexenta.nms.Container::set_child_propvoid  set_child_prop (string child_name, string propname, string propvalue)
com.nexenta.nms.Object::set_propvoid  set_prop (string propname, string value)
com.nexenta.nms.Container::trylockbool  trylock (string child_name, int32 lock_type)
com.nexenta.nms.Container::unlockvoid  unlock (string child_name, int32 lock_type)

16.1  com.nexenta.nms.Volume::attach_lun

void  attach_lun (string vol_name, string old_device, string new_device, string force_flag)

Attach to an existing mirror if the mirror containing already exists. Otherwise, if there is no mirror, form a new two-way mirror with an existing . If is already part of a two-way mirror, attaching new_device creates a three- way mirror, and so on. In all cases, starts resilvering immediately.

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
old_devicestringThe name of the old device used as a point of reference to attach
new_devicestringThe name of the new device
force_flagstring"-f" - forces use of even if it appears to be in use. "" (empty string) - do not force the replace_lun operation.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  volume_if->attach_lun('vol1', 'c2t0d0', 'c2t1d0', '') 

Attach 'c2t1d0' to 'c2t0d0' in volume 'vol1'

See Also
MethodShort Description
com.nexenta.nms.Volume::resolve_lun_to_volumesResolves LUN to its container volume(s).
com.nexenta.nms.Volume::get_luns_for_all_volumesGet all LUNs contained (or used) by the appliance's volumes ...
com.nexenta.nms.Volume::get_lunsGet LUNs of a given volume
com.nexenta.nms.Volume::attach_lunAttach to an existing mirror if the mirror containing ...
com.nexenta.nms.Volume::remove_lunPermanently remove a given device from the volume. This method ...
com.nexenta.nms.Volume::replace_lunReplace device in a mirror. The operation replaces with ...

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.2  com.nexenta.nms.Volume::clear_lun

void  clear_lun (string vol_name, string device_name)

Clear device errors in a volume. Device errors are periodically reported by the appliance's fault management "runners"; the errors can also be retrieved at any time using com.nexenta.nms.Volume::get_status and com.nexenta.nms.Volume::get_luns methods.

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
device_namestringThe name of the device
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  volume_if->clear_lun('vol1', 'c2t0d0') 

Clear correctable 'c2t0d0' errors from volume 'vol1'

See Also
MethodShort Description
com.nexenta.nms.Volume::resolve_lun_to_volumesResolves LUN to its container volume(s).
com.nexenta.nms.Volume::get_luns_for_all_volumesGet all LUNs contained (or used) by the appliance's volumes ...
com.nexenta.nms.Volume::get_lunsGet LUNs of a given volume
com.nexenta.nms.Volume::attach_lunAttach to an existing mirror if the mirror containing ...
com.nexenta.nms.Volume::remove_lunPermanently remove a given device from the volume. This method ...
com.nexenta.nms.Volume::replace_lunReplace device in a mirror. The operation replaces with ...

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.3  com.nexenta.nms.Volume::destroy

void  destroy (string vol_name)

Destroy the specified volume and free up devices it uses. This will also cleanup/destroy: (1) all dependent storage services, (2) all zvols based on a given volume, 3) all active indexers, and (4) unshare all shares if any. Depending on whether any/all of the (1) through (4) volume-based services/objects exist, the operation may include a fairly massive associated cleanup.

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  volume_if->destroy('vol1') 

Destroy volume 'vol1'

See Also
MethodShort Description
com.nexenta.nms.Container::destroyDestroy child object specified by its name
com.nexenta.nms.Snapshot::destroyDestroy the specified snapshot
com.nexenta.nms.Folder::destroyDestroy a given folder, its sub-folders and snapshots. The operation ...
com.nexenta.nms.Container::object_existsVerify that object exists
com.nexenta.nms.Container::trylockMake an attempt to lock the specified child

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.4  com.nexenta.nms.Volume::detach_lun

void  detach_lun (string vol_name, string device_name)

Detach device from a mirror

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
device_namestringThe name of the device
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  volume_if->detach_lun('vol1', 'c2t0d0') 

Detach 'c2t0d0' from volume 'vol1'. The operation will succeed only if the volume contains a mirrored group of devices that in turn contains 'c2t0d0'

See Also
MethodShort Description
com.nexenta.nms.Volume::resolve_lun_to_volumesResolves LUN to its container volume(s).
com.nexenta.nms.Volume::get_luns_for_all_volumesGet all LUNs contained (or used) by the appliance's volumes ...
com.nexenta.nms.Volume::get_lunsGet LUNs of a given volume
com.nexenta.nms.Volume::attach_lunAttach to an existing mirror if the mirror containing ...
com.nexenta.nms.Volume::remove_lunPermanently remove a given device from the volume. This method ...
com.nexenta.nms.Volume::replace_lunReplace device in a mirror. The operation replaces with ...

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.5  com.nexenta.nms.Volume::get_import_volumes

dictionary {string => dictionary {string => array of (string)}}  get_import_volumes (bool only_destroyed, string vol_name)

Get information on all or selected volumes that can be re-imported.

Parameters
NAMETYPEDESCRIPTION
only_destroyedboolonly_destroyed = 0 | 1. Non-zero (true) - get destroyed volumes that can be re-imported; zero (false) - get exported volumes,
vol_namestringThe name of the volume
Return Value
TYPEDESCRIPTION
dictionary {string => dictionary {string => array of (string)}}Dictionary { ID => { { volume-name => (state, destroyed), { desc => ( description ) }, { luns => (list of LUNs) }, { lun_states => (list of LUN states) } } Each exported or destroyed volume has a per-appliance unique ID - this ID is an outer key in the returned dictionary. The volume's ID onto 4 nested dictionaries, 4 specific records each describing a different aspect of the corresponding exported or destroyed volume. This includes: state of the volume, and whether it is in fact destroyed, list of all its LUNs and their respective states. The following example demonstrates this 2-level data structure: { '4023036841340811826' => { 'luns' => ( 'c2d0' ), 'volume' => ( 'vol1', 'ONLINE', '0' ), 'desc' => ( ' volume: vol1', ' id: 4023036841340811826', ' state: ONLINE', 'status: The volume is formatted using an older on-disk version.', 'action: The volume can be imported using its name or numeric identifier', 'config:', '', ' vol1 ONLINE', ' c2d0 ONLINE' ), 'luns_states' => ( 'ONLINE' ) } };
Usage Examples
1.  volume_if->get_import_volumes(0, '') 

Get all exported volumes An example of possibly returned dictionary follows: { '4023036841340811826' => { 'luns' => ( 'c2d0' ), 'volume' => ( 'vol1', 'ONLINE', '0' ), 'desc' => ( ' volume: vol1', ' id: 4023036841340811826', ' state: ONLINE', 'status: The volume is formatted using an older on-disk version.', 'action: The volume can be imported using its name or numeric identifier', 'config:', '', ' vol1 ONLINE', ' c2d0 ONLINE' ), 'luns_states' => ( 'ONLINE' ) } };

2.  volume_if->get_import_volumes(1, '') 

Get all destroyed volumes

3.  volume_if->get_import_volumes(1, 'vol1') 

Get information on destroyed volume 'vol1'

See Also
MethodShort Description
com.nexenta.nms.Volume::vol_importImport a volume
com.nexenta.nms.Volume::destroyDestroy the specified volume and free up devices it uses. ...
com.nexenta.nms.Volume::vol_createCreate a volume

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.6  com.nexenta.nms.Volume::get_luns

dictionary {string => array of (string)}  get_luns (string vol_name)

Get LUNs of a given volume

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
Return Value
TYPEDESCRIPTION
dictionary {string => array of (string)}Dictionary { LUN => (state, read, write, cksum, info, current) }. The returned dictionary contains a record per volume's LUN. The latter is a key in the dictionary that identifies or points to a simple array of 6 values: (state, read, write, cksum, info, current), where state is the current state of the LUN (online, offline, faulted, degraded), read, write and checksum reflect the corresponding error counters. The last two scalars in the per-LUN information are: info - a record of 'zpool status' information for a given LUN. and current - redundancy group that the LUN is part of (if any): mirror, raidz1, raidz2.
Usage Examples
1.  volume_if->get_luns('vol1') 

Return volume 'vol1' LUNs, their runtime status and descriptions. In its simplest form, an output may look like follows: { 'c2d0' => ( 'ONLINE', '0', '0', '0', '', '' ) }

See Also
MethodShort Description
com.nexenta.nms.Volume::resolve_lun_to_volumesResolves LUN to its container volume(s).
com.nexenta.nms.Volume::get_luns_for_all_volumesGet all LUNs contained (or used) by the appliance's volumes ...
com.nexenta.nms.Volume::detach_lunDetach device from a mirror
com.nexenta.nms.Volume::attach_lunAttach to an existing mirror if the mirror containing ...
com.nexenta.nms.Volume::remove_lunPermanently remove a given device from the volume. This method ...
com.nexenta.nms.Volume::replace_lunReplace device in a mirror. The operation replaces with ...

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.7  com.nexenta.nms.Volume::get_luns_for_all_volumes

array of (string)  get_luns_for_all_volumes (void)

Get all LUNs contained (or used) by the appliance's volumes

Parameters
NAMETYPEDESCRIPTION
None
Return Value
TYPEDESCRIPTION
array of (string)Array of LUN names, for instance: ('c7t2d0', 'c5t2d0', 'c6t7d0', 'c1t6d0', 'c4t6d0', 'c5t7d0', 'c4t0d0', 'c0t1d0', 'c1t5d0', 'c1t3d0'). The returned array does not include LUNs from exported or destroyed volumes. The returned arrays does not include LUNs that are not used for (by) appliance's volumes
See Also
MethodShort Description
com.nexenta.nms.Volume::resolve_lun_to_volumesResolves LUN to its container volume(s).
com.nexenta.nms.Volume::get_lunsGet LUNs of a given volume

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.8  com.nexenta.nms.Volume::get_names

array of (string)  get_names (string pattern)

Get volume names matching a specified pattern

Parameters
NAMETYPEDESCRIPTION
patternstringPattern to select a matching subset of volumes. An empty string will match all existing volumes
Return Value
TYPEDESCRIPTION
array of (string)Array of volumes matching the specified pattern
Usage Examples
1.  volume_if->get_names('^vol') 

Return only those volume names that start with 'vol'

2.  volume_if->get_names('') 

Get all appliance's volumes

See Also
MethodShort Description
com.nexenta.nms.Container::get_namesGet array of all (contained) children names matching the specified ...
com.nexenta.nms.Container::get_names_by_propGet array of all (container) children which has matching property ...
com.nexenta.nms.Folder::get_namesGet folder names matching a specified pattern
com.nexenta.nms.Folder::get_namesGet folder names matching a specified pattern
com.nexenta.nms.Snapshot::get_namesGet snapshot names matching a specified pattern

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.9  com.nexenta.nms.Volume::get_prop_valid_values

array of (string)  get_prop_valid_values (string prop_name)

Get valid range and/or enumeration for a given volume's property.

Parameters
NAMETYPEDESCRIPTION
prop_namestringThe name of the property.
Return Value
TYPEDESCRIPTION
array of (string)Array of strings.
Usage Examples
1.  volume_if->get_prop_valid_values('available') 

Will return ('').

2.  volume_if->get_prop_valid_values('cachefile') 

Will return ('', 'none').

3.  volume_if->get_prop_valid_values('autoreplace') 

Will return ('on', 'off').

See Also
MethodShort Description
com.nexenta.nms.Folder::set_child_propSet folder's property value
com.nexenta.nms.Folder::get_prop_valid_valuesGet valid range and/or enumeration for a given folder's property. ...

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.10  com.nexenta.nms.Volume::get_status

dictionary {string => array of (string)}  get_status (string vol_name)

Get volume's status

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
Return Value
TYPEDESCRIPTION
dictionary {string => array of (string)}Dictionary { key => (array of lines) }, where key has one of the following values: 'scrub', 'errors', 'status', 'action', 'config', 'state'. This returned dictionary describes the state of the specified volume in detail. Each key "points" to an array of lines that define the corresponding value in a human readable form. For instance, the following returned dictionary would describe a simple single-LUN volume: { 'scrub' => ( 'none requested' ), 'errors' => ( 'No known data errors' ), 'status' => ( 'The volume is formatted using an older on-disk format. The volume can', 'still be used, but some features are unavailable.' ), 'action' => ( 'Upgrade the volume. Once this is done, the', 'volume will no longer be accessible on older software versions.' ), 'config' => ( 'NAME STATE READ WRITE CKSUM', 'vol1 ONLINE 0 0 0', ' c2d0 ONLINE 0 0 0' ), 'state' => ( 'ONLINE' ) }. Notice that the volume 'vol1' in this case can be upgraded - as per 'action' (above) and its descriptions.
Usage Examples
1.  volume_if->get_status('vol1') 

Get current status of the volume 'vol1'.

See Also
MethodShort Description
com.nexenta.nms.Volume::get_import_volumesGet information on all or selected volumes that can be ...
com.nexenta.nms.Volume::get_lunsGet LUNs of a given volume
com.nexenta.nms.Volume::get_version_infoGet volume's ZFS version

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.11  com.nexenta.nms.Volume::get_version_info

array of (int32)  get_version_info (string vol_name)

Get volume's ZFS version

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
Return Value
TYPEDESCRIPTION
array of (int32)Array that consists of two integers: (system ZFS version, Volume's ZFS version)
Usage Examples
1.  volume_if->get_version_info('vol1') 

Get version information for the volume 'vol1'. Examples of returns: (10, 10) or (10, 9). The 2nd example return demonstrates the case when the volume's ZFS version (9) may be upgraded to the system version (10)

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.12  com.nexenta.nms.Volume::history

void  history (string vol_name, int32 time_begin, int32 time_end)

Get volume history records, in terms of executed ZFS commands and their timestamps. The subset of records returned is defined by the given range [ time_begin, time_end ]

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
time_beginint32Time (in seconds) from the start of epoch (00:00:00 UTC Jan 1st, 1970)
time_endint32Time (in seconds) from the start of epoch (00:00:00 UTC Jan 1st, 1970)
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  volume_if->history('vol1', 0, time()) 

Assuming time() is the way to get the current time in seconds, this will return all commands executed on 'vol1'

2.  volume_if->history('vol1', time() - 3600, time()) 

Assuming time() is the the current time in seconds, this will return all commands executed on 'vol1' during the last one 60 minutes.

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.13  com.nexenta.nms.Volume::offline_lun

void  offline_lun (string vol_name, string device_name)

Take the specified physical device offline. While the device is offline, no attempt is made to read or write to the device. This operation is not applicable to spares.

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
device_namestringThe name of the device
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  volume_if->offline_lun('vol1', 'c2t0d0') 

Take 'c2t0d0' offline in volume 'vol1'

See Also
MethodShort Description
com.nexenta.nms.Volume::resolve_lun_to_volumesResolves LUN to its container volume(s).
com.nexenta.nms.Volume::online_lunBring the specified physical device online. This operation is not ...
com.nexenta.nms.Volume::get_lunsGet LUNs of a given volume
com.nexenta.nms.Volume::attach_lunAttach to an existing mirror if the mirror containing ...
com.nexenta.nms.Volume::remove_lunPermanently remove a given device from the volume. This method ...
com.nexenta.nms.Volume::replace_lunReplace device in a mirror. The operation replaces with ...

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.14  com.nexenta.nms.Volume::online_lun

void  online_lun (string vol_name, string device_name)

Bring the specified physical device online. This operation is not applicable to spares.

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
device_namestringThe name of the device
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  volume_if->online_lun('vol1', 'c2t0d0') 

Bring online 'c2t0d0' from volume 'vol1'

See Also
MethodShort Description
com.nexenta.nms.Volume::resolve_lun_to_volumesResolves LUN to its container volume(s).
com.nexenta.nms.Volume::offline_lunTake the specified physical device offline. While the device is ...
com.nexenta.nms.Volume::get_lunsGet LUNs of a given volume
com.nexenta.nms.Volume::attach_lunAttach to an existing mirror if the mirror containing ...
com.nexenta.nms.Volume::remove_lunPermanently remove a given device from the volume. This method ...
com.nexenta.nms.Volume::replace_lunReplace device in a mirror. The operation replaces with ...

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.15  com.nexenta.nms.Volume::remove_lun

void  remove_lun (string vol_name, string device_name)

Permanently remove a given device from the volume. This method currently only supports removing hot spares.

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
device_namestringThe name of the device
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  volume_if->remove_lun('vol1', 'c2t0d0') 

Remove 'c2t0d0' from volume 'vol1'

See Also
MethodShort Description
com.nexenta.nms.Volume::resolve_lun_to_volumesResolves LUN to its container volume(s).
com.nexenta.nms.Volume::get_luns_for_all_volumesGet all LUNs contained (or used) by the appliance's volumes ...
com.nexenta.nms.Volume::get_lunsGet LUNs of a given volume
com.nexenta.nms.Volume::attach_lunAttach to an existing mirror if the mirror containing ...
com.nexenta.nms.Volume::remove_lunPermanently remove a given device from the volume. This method ...
com.nexenta.nms.Volume::replace_lunReplace device in a mirror. The operation replaces with ...

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.16  com.nexenta.nms.Volume::replace_lun

void  replace_lun (string vol_name, string old_device, string new_device, string force_flag)

Replace device in a mirror. The operation replaces with . This is equivalent to attaching (via com.nexenta.nms.Volume::attach_lun) , waiting for it to resilver, and then detaching (via com.nexenta.nms.Volume::detach_lun) .

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
old_devicestringThe name of the old device, to be replaced
new_devicestringThe name of the new device, to be used instead of the
force_flagstring"-f" - forces use of even if it appears to be in use. "" (empty string) - do not force the replace_lun operation.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  volume_if->replace_lun('vol1', 'c2t0d0', 'c2t1d0', '') 

Replace 'c2t0d0' with 'c2t0d0' in volume 'vol1'

See Also
MethodShort Description
com.nexenta.nms.Volume::attach_lunAttach to an existing mirror if the mirror containing ...
com.nexenta.nms.Volume::detach_lunDetach device from a mirror
com.nexenta.nms.Volume::get_lunsGet LUNs of a given volume
com.nexenta.nms.Volume::remove_lunPermanently remove a given device from the volume. This method ...
com.nexenta.nms.Volume::vol_growGrow a volume

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.17  com.nexenta.nms.Volume::resolve_lun_to_volumes

array of (string)  resolve_lun_to_volumes (string disk_name)

Resolves LUN to its container volume(s).

Parameters
NAMETYPEDESCRIPTION
disk_namestringThe name of the disk. For instance: 'c5t3d0' or 'c0d1'
Return Value
TYPEDESCRIPTION
array of (string)Array of volume names. An empty array is returned if the LUN is not used by any volume in the system. Typically, a non-empty array (of volume names) will contain a name of a single volume.
Usage Examples
1.  volume_if->resolve_lun_to_volumes('vol1/zvol1') -- resolve the specified zvol to its volume. The returned array in this case: ('vol1').o@usage_2 resolve_lun_to_volumes('c6t7d0') 

Find volume(s) that use 'c6t7d0'.

See Also
MethodShort Description
com.nexenta.nms.Volume::get_lunsGet LUNs of a given volume
com.nexenta.nms.Volume::get_luns_for_all_volumesGet all LUNs contained (or used) by the appliance's volumes ...

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.18  com.nexenta.nms.Volume::upgrade

bool  upgrade (string vol_name)

Upgrade volume's ZFS version. WARNING: special consideration need to be given to upgrading system volume. This operation may affect availability of system checkpoints! Upgrading the system volume to a newer ZFS version will make all system checkpoints created with older ZFS versions non-bootable and therefore not available for rollback. The existing checkpoints will still be accessible via regular file level access operations

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
Return Value
TYPEDESCRIPTION
boolNon-zero (true) - the volume is successfully upgraded to the system ZFS version; zero (false) - the volume is already at the system ZFS version, nothing to do.
Usage Examples
1.  volume_if->upgrade('vol1') 

Upgrade volume 'vol1' to the system ZFS version

See Also
MethodShort Description
com.nexenta.nms.Folder::get_version_infoGet folder's ZFS version
com.nexenta.nms.Volume::get_version_infoGet volume's ZFS version
com.nexenta.nms.Folder::upgradeUpgrade folder's ZFS version

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.19  com.nexenta.nms.Volume::vol_create

array of (string)  vol_create (string vol_name, string cmd, bool dry_run, bool force, dictionary {string => string} creation_time_props)

Create a volume

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
cmdstringThe command is a sequence of grouping keywords ('mirror', 'raidz1', 'raidz2', 'log'), each followed by LUN names. For instance, 'c0d0 c1d0' - create a volume (pool) of two disks, while 'mirror c0d0 c1d0' will create a volume that contains a single (two-way) mirror of two devices. The LUNs used to create a volume must be available for allocation.
dry_runbooldry_run = 0 | 1. Non-zero (true) - simulate volume creation without actually creating it. Zero (false) value must be used to create the volume.
forceboolforce = 0 | 1. If true (that is, non-zero), forces volume creation even if the LUNs appear to be in use.
creation_time_propsdictionary {string => string}{ Property Name => Property Value } dictionary of property names and their values specified at creation time.
Return Value
TYPEDESCRIPTION
array of (string)In the case of dry-run, returns array of lines that describe what will be the volume structure in terms of redundancy groups and subordinate disks (LUNs) once the volume is actually created. Otherwise, an empty array is returned if the volume was created successfully.
Usage Examples
1.  volume_if->vol_create('vol1', 'raidz c0t0d0 c1t0d0 c6t0d0 c7t0d0 c4t0d0', 0, 0, {}) 

Create volume 'vol1' as a single RAID-Z group of 5 disks.

2.  volume_if->vol_create('vol1', 'c0t0d0 c1t0d0 c6t0d0 c7t0d0 c4t0d0', 0, 1, {}) 

Force creating volume 'vol1' as a simple non-redundant pool of 5 disks.

3.  volume_if->vol_create('vol1', 'c0t0d0 c1t0d0 c6t0d0 c7t0d0 c4t0d0', 0, 0, { version => '9', 'failmode' => 'wait' }) 

Create volume 'vol1' as a simple non-redundant pool of 5 disks, and in addition specify/set creation time properties: 'version' and 'failmode'.

See Also
MethodShort Description
com.nexenta.nms.Folder::createCreate a "path" of folders
com.nexenta.nms.Snapshot::destroyDestroy the specified snapshot
com.nexenta.nms.Folder::destroyDestroy a given folder, its sub-folders and snapshots. The operation ...
com.nexenta.nms.Volume::destroyDestroy the specified volume and free up devices it uses. ...
com.nexenta.nms.Folder::create_snapshotSnapshot a given folder and possibly its sub-folders
com.nexenta.nms.Folder::create_with_propsCreate a "path" of folders. This API allows to specify ...
com.nexenta.nms.Volume::vol_growGrow a volume
com.nexenta.nms.Volume::vol_importImport a volume

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.20  com.nexenta.nms.Volume::vol_export

void  vol_export (string vol_name)

Export the specified volume. This will also cleanup/destroy: (1) all dependent storage services, (2) all zvols based on a given volume, 3) all active indexers, and (4) unshare all shares if any.

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume to be exported
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  volume_if->vol_export('vol1') 

Export volume 'vol1'

See Also
MethodShort Description
com.nexenta.nms.Volume::get_import_volumesGet information on all or selected volumes that can be ...
com.nexenta.nms.Volume::vol_importImport a volume
com.nexenta.nms.Volume::destroyDestroy the specified volume and free up devices it uses. ...
com.nexenta.nms.Volume::vol_createCreate a volume

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.21  com.nexenta.nms.Volume::vol_grow

array of (string)  vol_grow (string vol_name, string cmd, bool dry_run, bool force)

Grow a volume

Parameters
NAMETYPEDESCRIPTION
vol_namestringThe name of the volume
cmdstringCommand to "grow" the volume. The command is a sequence of grouping keywords ('pool', 'mirror', 'raidz1', 'raidz2', 'log', 'spare'), each followed by LUN names, for instance 'mirror c0d0 c1d0' - add a mirror of two devices to an existing volume. The LUNs used to "grow" a volume must be available for allocation.
dry_runbooldry_run = 0 | 1. Non-zero (true) - simulate volume creation without actually creating it. Zero (false) - create the volume.
forceboolforce = 0 | 1. If true (that is, non-zero), forces the operation even if the LUNs appear to be in use.
Return Value
TYPEDESCRIPTION
array of (string)In the case of dry-run, returns array of lines that describe the volume structure in terms of redundancy groups and subordinate disks (LUNs). Otherwise (dry-run = 0) - an empty array.
Usage Examples
1.  volume_if->vol_grow('vol1', 'raidz c0t0d0 c1t0d0 c6t0d0 c7t0d0 c4t0d0', 0, 0) 

Add a single RAID-Z group of 5 disks to an existing volume 'vol1'.

See Also
MethodShort Description
com.nexenta.nms.Volume::vol_createCreate a volume
com.nexenta.nms.Volume::destroyDestroy the specified volume and free up devices it uses. ...
com.nexenta.nms.Folder::create_with_propsCreate a "path" of folders. This API allows to specify ...
com.nexenta.nms.Volume::detach_lunDetach device from a mirror
com.nexenta.nms.Volume::attach_lunAttach to an existing mirror if the mirror containing ...
com.nexenta.nms.Volume::remove_lunPermanently remove a given device from the volume. This method ...
com.nexenta.nms.Volume::replace_lunReplace device in a mirror. The operation replaces with ...

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

16.22  com.nexenta.nms.Volume::vol_import

void  vol_import (string vold_name, string vold_id, string vnew_name, bool force, bool include_destroyed, dictionary {string => string} import_time_props)

Import a volume

Parameters
NAMETYPEDESCRIPTION
vold_namestringThe name of exported (explicitly, via com.nexenta.nms.Volume::export method or implicitly, by removing the disks), or destroyed volume.
vold_idstringID of the exported or destroyed volume, as reported by com.nexenta.nms.Volume::get_import_volumes method. The numeric system-unique ID is optional and may be set to an empty string '' if using just the volume name does not create an ambiguity.
vnew_namestringEmpty string '' - the imported volume will retain its old name . Otherwise, the volume will show up in the system under the new name
forceboolforce = 0 | 1. Non-zero (true) - force the import, for instance if the volume was not exported but physically removed. Zero (false) value can be used not to force import operation.
include_destroyedboolinclude_destroyed = 0 | 1. Non-zero (true) - import destroyed volumes, zero (false) - do not import destroyed volumes.
import_time_propsdictionary {string => string}{ Property Name => Property Value } dictionary of property names and their values specified at volume-import time.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  volume_if->vol_import('vol1', '', '', 0, 0, {}) 

Import exported volume 'vol1' under its own name.

2.  volume_if->vol_import('vol1', '4354576598783234', 'vol_new', 1, 0, {}) 

Force import of the volume 'vol1' also identified by its unique numeric identifier; use new name 'vol_new' for the imported volume

3.  vol_create('vol1', '', '', 0, 0, { 'failmode' => 'wait' }) 

Import volume 'vol1' and simultaneously set its 'failmode' property to 'wait'

See Also
MethodShort Description
com.nexenta.nms.Volume::get_import_volumesGet information on all or selected volumes that can be ...
com.nexenta.nms.Folder::createCreate a "path" of folders
com.nexenta.nms.Snapshot::destroyDestroy the specified snapshot
com.nexenta.nms.Folder::destroyDestroy a given folder, its sub-folders and snapshots. The operation ...
com.nexenta.nms.Volume::destroyDestroy the specified volume and free up devices it uses. ...
com.nexenta.nms.Folder::create_snapshotSnapshot a given folder and possibly its sub-folders
com.nexenta.nms.Folder::create_with_propsCreate a "path" of folders. This API allows to specify ...
com.nexenta.nms.Volume::vol_growGrow a volume
com.nexenta.nms.Volume::vol_createCreate a volume

Previous Section: Logical and Physical Disk ManagementTable Of ContentsNext Section: Zvol (Emulated Volume-based Block Device)

17  Zvol (Emulated Volume-based Block Device)

SA-API Interface Object

D-Bus name Interface class name Inherits
/Root/Zvolcom.nexenta.nms.ZvolVirtual Container
Properties
NAMEDESCRIPTION
availablezfs(1m): The amount of space available to the dataset and all its children, assuming that there is no other activity in the pool. Because space is shared within a pool, availability can be limited by any number of factors, including physical pool size, quotas, reservations, or other datasets within the pool.
checksumzfs(1m): checksum = on | off | fletcher2 | fletcher4 | sha256. Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, fletcher2, but this may change in future releases). The value "off" disables integrity checking on user data. Disabling checksums is NOT a recommended practice.
compressionzfs(1m): compression = on | off | lzjb | gzip | gzip-N. Controls the compression algorithm used for this dataset. The "lzjb" compression algorithm is optimized for performance while providing decent data compression. Setting compression to "on" uses the "lzjb" compression algorithm. The "gzip" compression algorithm uses the same compression as the gzip(1) command. You can specify the "gzip" level by using the value "gzip-N" where N is an integer from 1 (fastest) to 9 (best compression ratio). Currently, "gzip" is equivalent to "gzip-6" (which is also the default for gzip(1)).
compressratiozfs(1m): The compression ratio achieved for this dataset, expressed as a multiplier. The default value is "off".
copieszfs(1m): copies = 1 | 2 | 3. Controls the number of copies of data stored for this dataset. These copies are in addition to any redundancy provided by the pool, for example, mirroring or raid-z. The copies are stored on different disks, if possible. The space used by multiple copies is charged to the associated file and dataset, changing the "used" property and counting against quotas and reservations. Changing this property only affects newly-written data. Therefore, set this property at file system creation time.
creationzfs(1m): The time this dataset was created.
infoGeneral information about the object
ipc_nameInterface class name of the associated interface object
nameThe name of the object
originFor cloned zvols - the snapshot from which the clone was created. The origin cannot be destroyed (even with the -r or -f options) so long as a clone exists.
primarycacheTBD
readonlyzfs(1m): readonly = on | off. Controls whether this dataset can be modified. The default value is "off".
referencedzfs(1m): The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are identical.
refreservationzfs(1m): refreservation = size | none. The minimum amount of space guaranteed to a dataset, not including its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by refreservation. The refreservation reservation is accounted for in the parent datasets' space used, and counts against the parent datasets' quotas and reservations. If refreservation is set, a snapshot is only allowed if there is enough free pool space outside of this reservation to accommodate the current number of "referenced" bytes in the dataset.
reservationzfs(1m): reservation = size | none. The minimum amount of space guaranteed to a dataset and its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by its reservation. Reservations are accounted for in the parent datasets' space used, and count against the parent datasets' quotas and reservations.
secondarycacheTBD
shareiscsiThe valid values are: "on" and "off" (default). The property specifies whether zvol is exported as an iSCSI Target.
sizezvol size (in bytes)
swapValue of this property is "yes" if zvol is used as a swap area;otherwise the value is "no"
typeThe type of dataset.
usedzfs(1m): The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendent datasets. The amount of space that a dataset consumes from its parent, as well as the amount of space that are freed if this dataset is recursively destroyed, is the greater of its space used and its reservation. When snapshots are created, their space is initially shared between the snapshot and the file system, and possibly with previous snapshots. As the file system changes, space that was previously shared becomes unique to the snapshot, and counted in the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots. The amount of space used, available, or referenced does not take into account pending changes. Pending changes are generally accounted for within a few seconds.
usedbychildrenTBD
usedbydatasetTBD
usedbyrefreservationTBD
usedbysnapshotsTBD
volblocksizezfs(1m): For volumes, specifies the block size of the volume. The blocksize cannot be changed once the volume has been written, so it should be set at volume creation time. The default blocksize for volumes is 8 Kbytes. Any power of 2 from 512 bytes to 128 Kbytes is valid.
volsizevolsize = size. Specifies the logical size of the zvol.
volume_nameThe name of the underlying volume
zvol_namePartial zvol name. Note tha a fully qualified zvol pathname is a '/' delimited combination of volume_name followed by zvol_name
Inherited Methods
NAMEPROTOTYPE
com.nexenta.nms.Container::get_child_propstring  get_child_prop (string child_name, string propname)
com.nexenta.nms.Container::get_child_propsdictionary {string => string}  get_child_props (string child_name, string pattern)
com.nexenta.nms.Container::get_names_by_proparray of (string)  get_names_by_prop (string propname, string propval_pattern, string childname_pattern)
com.nexenta.nms.Object::get_propstring  get_prop (string propname)
com.nexenta.nms.Object::get_propsdictionary {string => string}  get_props (string pattern)
com.nexenta.nms.Container::object_existsbool  object_exists (string child_name)
com.nexenta.nms.Object::set_propvoid  set_prop (string propname, string value)
com.nexenta.nms.Container::trylockbool  trylock (string child_name, int32 lock_type)
com.nexenta.nms.Container::unlockvoid  unlock (string child_name, int32 lock_type)

17.1  com.nexenta.nms.Zvol::clone

void  clone (string zname_snapname, string target_zname)

Clone a given zvol. The operation results in a writable zvol named , with its initial contents identical to the one of the snapshot

Parameters
NAMETYPEDESCRIPTION
zname_snapnamestringA fully qualified snapshot name of the following layout: zname@snapname. For instance, clone('vol1/zvol1@today', ...) would result in cloning zvol 'vol1/zvol1' at the exact point in time of creation snapshot 'vol1/zvol1@today' and with the exact content captured by the 'vol1/zvol1@today'. To clone folders, please use com.nexenta.nms.Folder::clone API.
target_znamestringThe name of the target (cloned and writable) zvol.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  zvol_if->clone('vol1/a/zvol2@today', 'vol1/clone_ab') 

Clone 'vol1/a/zvol2@today' as a new zvol named 'vol1/clone_ab'

See Also
MethodShort Description
com.nexenta.nms.Snapshot::createCreate (ie, take) snapshots, recursively or non-recursively, depending on the ...
com.nexenta.nms.Folder::cloneCreates a clone of a given snapshot. The operation results ...

Previous Section: Volume (Pool)Table Of ContentsNext Section: Folder (Filesystem)

17.2  com.nexenta.nms.Zvol::create

void  create (string zname, string devsize, string blocksize, bool sparse)

Create new zvol. Background: the appliance provides an easy iSCSI and FC target integration which we call "zvol". Zvol is an emulated (virtual) block device based on a given appliance's volume. Zvol can be used as additional swap partition but its primary usage is iSCSI and FC. Zvol is a powerful and flexible tool in part because of its tight integration with appliance's storage services; these storage services allow the zvol to be managed, compressed, replicated, have snapshots taken of it and so forth. Being a block device, zvol is effectively a LUN remotely accessible via iSCSI or FC. Also, zvol can be thin provisioned, and can be grown over time, both in terms of its effective and maximum size. Thin provisioned (also called "sparse") zvol does not allocate its specified maximum size. At creation time thin provisioned zvol actually allocates only a minimum required to store its own metatadata.

Parameters
NAMETYPEDESCRIPTION
znamestringZvol pathname, for instance 'vol1/zvol1', where vol1 would be the name of an underlying volume
devsizestringMaximum size of the device, e.g.: 100GB, 500M, 100K
blocksizestringBlock size of the device (default 8KB)
sparseboolsparse = 0 | 1. If true (non-zero), creates a "sparse" (that is, thinly provisioned) device with no initial reservation. A thinly provisioned zvol starts small and then possibly grows up to the specified . The effective used size is limited by the specified
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  zvol_if->create('vol1/zvol1', '500GB', '128KB', 1) 

Create sparse block device based on the volume 'vol1', with maximum size 500 GB and block size 128 KB

See Also
MethodShort Description
com.nexenta.nms.Folder::createCreate a "path" of folders
com.nexenta.nms.Snapshot::destroyDestroy the specified snapshot
com.nexenta.nms.Folder::destroyDestroy a given folder, its sub-folders and snapshots. The operation ...
com.nexenta.nms.Volume::destroyDestroy the specified volume and free up devices it uses. ...
com.nexenta.nms.Folder::create_snapshotSnapshot a given folder and possibly its sub-folders
com.nexenta.nms.Folder::create_with_propsCreate a "path" of folders. This API allows to specify ...
com.nexenta.nms.Volume::vol_createCreate a volume
com.nexenta.nms.IscsiTgt::set_portalAdd new or modify existing target portal group. Target Portal ...
com.nexenta.nms.IscsiTgt::get_defaultsGet the configured Target parameters. The list includes: RadiusServer, RadiusAccess, ...
com.nexenta.nms.IscsiTgt::set_defaultUpdate the specified Target parameter. The list of system-wide (global) ...
com.nexenta.nms.IscsiTgt::get_initiatorsList all iSCSI Initiators connected to the specified Target ...
com.nexenta.nms.IscsiTgt::set_zvol_tpgtSet Target Portal Group for a given zvol
com.nexenta.nms.IscsiTgt::list_zvolRetrieve zvol information from appliance's SCSI sub-system. This API is ...

Previous Section: Volume (Pool)Table Of ContentsNext Section: Folder (Filesystem)

17.3  com.nexenta.nms.Zvol::create_snapshot

void  create_snapshot (string zname, string snapname, bool recursive)

Snapshot a given zvol

Parameters
NAMETYPEDESCRIPTION
znamestringZvol pathname - a fully qualified name of the zvol object
snapnamestringA partial name of the snapshot to be created, for instance: today
recursiveboolrecursive = 0 | 1. If true (ie, non-zero), recursively create snapshots of all descendent datasets
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  zvol_if->create_snapshot('vol1/zvol1', 'today', 0) 

Non-recursively snapshot block device 'vol1/zvol1' and name the snapshot 'vol1/zvol1@today'

See Also
MethodShort Description
com.nexenta.nms.Snapshot::destroyDestroy the specified snapshot
com.nexenta.nms.Volume::destroyDestroy the specified volume and free up devices it uses. ...
com.nexenta.nms.Folder::create_snapshotSnapshot a given folder and possibly its sub-folders

Previous Section: Volume (Pool)Table Of ContentsNext Section: Folder (Filesystem)

17.4  com.nexenta.nms.Zvol::create_with_props

void  create_with_props (string zname, string devsize, string blocksize, bool sparse, dictionary {string => string} creation_time_props)

Create a new zvol. This API allows to specify creation time properties (compare with com.nexenta.nms.Zvol::create). Background: the appliance provides an easy iSCSI and FC target integration which we call "zvol". Zvol is an emulated (virtual) block device based on a given appliance's volume. Zvol can be used as additional swap partition but its primary usage is iSCSI and FC. Zvol is a powerful and flexible tool in part because of its tight integration with appliance's storage services; these storage services allow the zvol to be managed, compressed, replicated, have snapshots taken of it and so forth. Being a block device, zvol is effectively a LUN remotely accessible via iSCSI or FC. Also, zvol can be thin provisioned, and can be grown over time, both in terms of its effective and maximum size. Thin provisioned (also called "sparse") zvol does not allocate its specified maximum size. At creation time thin provisioned zvol actually allocates only a minimum required to store its own metatadata.

Parameters
NAMETYPEDESCRIPTION
znamestringZvol pathname, for instance 'vol1/zvol1', where vol1 would be the name of an underlying volume
devsizestringMaximum size of the device, e.g.: 100GB, 500M, 100K
blocksizestringBlock size of the device (default 8KB)
sparseboolsparse = 0 | 1. If true (non-zero), creates a "sparse" (that is, thinly provisioned) device with no initial reservation. A thinly provisioned zvol starts small and then possibly grows up to the specified . The effective used size is limited by the specified
creation_time_propsdictionary {string => string}{ Property Name => Property Value } dictionary of property names and their values specified at creation time.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  zvol_if->create_with_props('vol1/zvol1', '500GB', '128KB', 1, {}) 

Create sparse block device based on the volume 'vol1', with maximum size 500 GB and block size 128 KB. Note that in this example an empty dictionary is passed for creation_time_props.

2.  zvol_if->create_with_props('vol1/zvol1', '500GB', '128KB', 1, {'shareiscsi' => 'on'}) 

Create and share via iSCSI a sparse block device based on the volume 'vol1', with maximum size 500 GB and block size 128 KB. In this example creation time property is: shareiscsi = 'on'.

See Also
MethodShort Description
com.nexenta.nms.Zvol::createCreate new zvol. Background: the appliance provides an easy iSCSI ...
com.nexenta.nms.Container::destroyDestroy child object specified by its name
com.nexenta.nms.Zvol::destroyDestroy existing zvol
com.nexenta.nms.Volume::destroyDestroy the specified volume and free up devices it uses. ...
com.nexenta.nms.Snapshot::createCreate (ie, take) snapshots, recursively or non-recursively, depending on the ...
com.nexenta.nms.IscsiTgt::set_portalAdd new or modify existing target portal group. Target Portal ...
com.nexenta.nms.IscsiTgt::get_defaultsGet the configured Target parameters. The list includes: RadiusServer, RadiusAccess, ...
com.nexenta.nms.IscsiTgt::set_defaultUpdate the specified Target parameter. The list of system-wide (global) ...
com.nexenta.nms.IscsiTgt::get_initiatorsList all iSCSI Initiators connected to the specified Target ...
com.nexenta.nms.IscsiTgt::set_zvol_tpgtSet Target Portal Group for a given zvol
com.nexenta.nms.IscsiTgt::list_zvolRetrieve zvol information from appliance's SCSI sub-system. This API is ...

Previous Section: Volume (Pool)Table Of ContentsNext Section: Folder (Filesystem)

17.5  com.nexenta.nms.Zvol::destroy

void  destroy (string zname, string extra_options)

Destroy existing zvol

Parameters
NAMETYPEDESCRIPTION
znamestringZvol pathname - a fully qualified name of the zvol object
extra_optionsstringAdditional options include any one or a combination of: "-r" (recursive) - to recursively destroy all snapshots of this zvol, "-R" - to recursively destroy all dependents, including snapshots and clones of this zvol, "-f" - to force unmount even if there are open files. Caution! Extreme care should be taken when applying either the -r or the -R or the -f options.
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  zvol_if->destroy('vol1/zvol1', '-r') 

Destroy zvol 'vol1/zvol1' and its snapshots

See Also
MethodShort Description
com.nexenta.nms.Container::destroyDestroy child object specified by its name
com.nexenta.nms.Volume::destroyDestroy the specified volume and free up devices it uses. ...
com.nexenta.nms.Folder::destroyDestroy a given folder, its sub-folders and snapshots. The operation ...
com.nexenta.nms.Container::object_existsVerify that object exists
com.nexenta.nms.Container::trylockMake an attempt to lock the specified child

Previous Section: Volume (Pool)Table Of ContentsNext Section: Folder (Filesystem)

17.6  com.nexenta.nms.Zvol::get_names

array of (string)  get_names (string pattern)

Get zvol names matching a specified pattern.

Parameters
NAMETYPEDESCRIPTION
patternstringPattern to select a matching subset of zvols. An empty string will match all existing zvols
Return Value
TYPEDESCRIPTION
array of (string)Array of zvol names matching the specified pattern
Usage Examples
1.  zvol_if->get_names('') 

Get names of all zvols in the appliance

See Also
MethodShort Description
com.nexenta.nms.Container::get_namesGet array of all (contained) children names matching the specified ...
com.nexenta.nms.Container::get_names_by_propGet array of all (container) children which has matching property ...
com.nexenta.nms.Folder::get_namesGet folder names matching a specified pattern
com.nexenta.nms.Volume::get_namesGet volume names matching a specified pattern
com.nexenta.nms.Snapshot::get_namesGet snapshot names matching a specified pattern

Previous Section: Volume (Pool)Table Of ContentsNext Section: Folder (Filesystem)

17.7  com.nexenta.nms.Zvol::get_prop_valid_values

array of (string)  get_prop_valid_values (string prop_name)

Get valid range and/or enumeration for a given zvol's property.

Parameters
NAMETYPEDESCRIPTION
prop_namestringThe name of the property.
Return Value
TYPEDESCRIPTION
array of (string)Array of strings.
Usage Examples
1.  zvol_if->get_prop_valid_values('available') 

Will return ('').

2.  zvol_if->get_prop_valid_values('recordsize') 

Will return ('512 to 128k, power of 2').

3.  zvol_if->get_prop_valid_values('volsize') 

Will return ('size').

See Also
MethodShort Description
com.nexenta.nms.Folder::set_child_propSet folder's property value
com.nexenta.nms.Folder::get_prop_valid_valuesGet valid range and/or enumeration for a given folder's property. ...
com.nexenta.nms.Zvol::set_child_propSet property value
com.nexenta.nms.Volume::get_prop_valid_valuesGet valid range and/or enumeration for a given volume's property. ...

Previous Section: Volume (Pool)Table Of ContentsNext Section: Folder (Filesystem)

17.8  com.nexenta.nms.Zvol::set_child_prop

void  set_child_prop (string zname, string propname, string propvalue)

Set property value

Parameters
NAMETYPEDESCRIPTION
znamestringThe name of the zvol
propnamestringThe name of the property. The following zvol properties are available for modification: compression, reservation, checksum, copies, readonly, shareiscsi
propvaluestringNew value of the property
Return Value
TYPEDESCRIPTION
voidNone
Usage Examples
1.  zvol_if->set_child_prop('vol1/zvol1', 'shareiscsi', 'on') 

Share the specified zvol via iSCSI. Note that for the very first iSCSI-shared zvol the appliance will automatically (behind the scenes) enable iSCSI target, if disabled

See Also
MethodShort Description
com.nexenta.nms.Object::get_propGet property value
com.nexenta.nms.Object::set_propSet property value
com.nexenta.nms.Container::set_child_propFor a given (contained) child update the specified property with ...
com.nexenta.nms.Container::get_child_pr