Develop for XenServer

Class: VIF

A virtual network interface

Fields for class: VIF

Field Type Qualifier Description
allowed_operations vif_operations set RO/runtime list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
current_operations (string -> vif_operations) map RO/runtime links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
currently_attached bool RO/constructor is the device currently attached (erased on reboot)
device string RO/constructor order in which VIF backends are created by xapi
ipv4_addresses string set RO/runtime IPv4 addresses in CIDR format
ipv4_allowed string set RO/constructor A list of IPv4 addresses which can be used to filter traffic passing through this VIF
ipv4_configuration_mode vif_ipv4_configuration_mode RO/runtime Determines whether IPv4 addresses are configured on the VIF
ipv4_gateway string RO/runtime IPv4 gateway (the empty string means that no gateway is set)
ipv6_addresses string set RO/runtime IPv6 addresses in CIDR format
ipv6_allowed string set RO/constructor A list of IPv6 addresses which can be used to filter traffic passing through this VIF
ipv6_configuration_mode vif_ipv6_configuration_mode RO/runtime Determines whether IPv6 addresses are configured on the VIF
ipv6_gateway string RO/runtime IPv6 gateway (the empty string means that no gateway is set)
locking_mode vif_locking_mode RO/constructor current locking mode of the VIF
MAC string RO/constructor ethernet MAC address of virtual interface, as exposed to guest
MAC_autogenerated bool RO/runtime true if the MAC was autogenerated; false indicates it was set manually
metrics VIF_metrics ref RO/runtime Removed. metrics associated with this VIF
MTU int RO/constructor MTU in octets
network network ref RO/constructor virtual network to which this vif is connected
other_config (string -> string) map RW additional configuration
qos_algorithm_params (string -> string) map RW parameters for chosen QoS algorithm
qos_algorithm_type string RW QoS algorithm to use
qos_supported_algorithms string set RO/runtime supported QoS algorithms for this VIF
runtime_properties (string -> string) map RO/runtime Device runtime properties
status_code int RO/runtime error/success code associated with last attach-operation (erased on reboot)
status_detail string RO/runtime error/success information associated with last attach-operation status (erased on reboot)
uuid string RO/runtime Unique identifier/object reference
VM VM ref RO/constructor virtual machine to which this vif is connected

RPCs associated with class: VIF

RPC name: add_ipv4_allowed

Overview:

Associates an IPv4 address with this VIF

Signature:

void add_ipv4_allowed (session ref session_ref, VIF ref self, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF which the IP address will be associated with
string value The IP address which will be associated with the VIF

Minimum Role: pool-operator

Return Type: void

RPC name: add_ipv6_allowed

Overview:

Associates an IPv6 address with this VIF

Signature:

void add_ipv6_allowed (session ref session_ref, VIF ref self, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF which the IP address will be associated with
string value The IP address which will be associated with the VIF

Minimum Role: pool-operator

Return Type: void

RPC name: add_to_other_config

Overview:

Add the given key-value pair to the other_config field of the given VIF.

Signature:

void add_to_other_config (session ref session_ref, VIF ref self, string key, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object
string key Key to add
string value Value to add

Minimum Role: vm-admin

Return Type: void

RPC name: add_to_qos_algorithm_params

Overview:

Add the given key-value pair to the qos/algorithm_params field of the given VIF.

Signature:

void add_to_qos_algorithm_params (session ref session_ref, VIF ref self, string key, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object
string key Key to add
string value Value to add

Minimum Role: vm-admin

Return Type: void

RPC name: configure_ipv4

Overview:

Configure IPv4 settings for this virtual interface

Signature:

void configure_ipv4 (session ref session_ref, VIF ref self, vif_ipv4_configuration_mode mode, string address, string gateway)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF to configure
vif_ipv4_configuration_mode mode Whether to use static or no IPv4 assignment
string address The IPv4 address in / format (for static mode only)
string gateway The IPv4 gateway (for static mode only; leave empty to not set a gateway)

Minimum Role: vm-operator

Return Type: void

RPC name: configure_ipv6

Overview:

Configure IPv6 settings for this virtual interface

Signature:

void configure_ipv6 (session ref session_ref, VIF ref self, vif_ipv6_configuration_mode mode, string address, string gateway)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF to configure
vif_ipv6_configuration_mode mode Whether to use static or no IPv6 assignment
string address The IPv6 address in / format (for static mode only)
string gateway The IPv6 gateway (for static mode only; leave empty to not set a gateway)

Minimum Role: vm-operator

Return Type: void

RPC name: create

Overview:

Create a new VIF instance, and return its handle.

Signature:

VIF ref create (session ref session_ref, VIF record args)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF record args All constructor arguments

Minimum Role: vm-admin

Return Type: VIF ref

reference to the newly created object

RPC name: destroy

Overview:

Destroy the specified VIF instance.

Signature:

void destroy (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: vm-admin

Return Type: void

RPC name: get_all

Overview:

Return a list of all the VIFs known to the system.

Signature:

VIF ref set get_all (session ref session_ref)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session

Minimum Role: read-only

Return Type: VIF ref set

references to all objects

RPC name: get_all_records

Overview:

Return a map of VIF references to VIF records for all VIFs known to the system.

Signature:

(VIF ref -> VIF record) map get_all_records (session ref session_ref)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session

Minimum Role: read-only

Return Type: (VIF ref -> VIF record) map

records of all objects

RPC name: get_allowed_operations

Overview:

Get the allowed_operations field of the given VIF.

Signature:

vif_operations set get_allowed_operations (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: vif_operations set

value of the field

RPC name: get_by_uuid

Overview:

Get a reference to the VIF instance with the specified UUID.

Signature:

VIF ref get_by_uuid (session ref session_ref, string uuid)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
string uuid UUID of object to return

Minimum Role: read-only

Return Type: VIF ref

reference to the object

RPC name: get_current_operations

Overview:

Get the current_operations field of the given VIF.

Signature:

(string -> vif_operations) map get_current_operations (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: (string -> vif_operations) map

value of the field

RPC name: get_currently_attached

Overview:

Get the currently_attached field of the given VIF.

Signature:

bool get_currently_attached (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: bool

value of the field

RPC name: get_device

Overview:

Get the device field of the given VIF.

Signature:

string get_device (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_ipv4_addresses

Overview:

Get the ipv4_addresses field of the given VIF.

Signature:

string set get_ipv4_addresses (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string set

value of the field

RPC name: get_ipv4_allowed

Overview:

Get the ipv4_allowed field of the given VIF.

Signature:

string set get_ipv4_allowed (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string set

value of the field

RPC name: get_ipv4_configuration_mode

Overview:

Get the ipv4_configuration_mode field of the given VIF.

Signature:

vif_ipv4_configuration_mode get_ipv4_configuration_mode (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: vif_ipv4_configuration_mode

value of the field

RPC name: get_ipv4_gateway

Overview:

Get the ipv4_gateway field of the given VIF.

Signature:

string get_ipv4_gateway (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_ipv6_addresses

Overview:

Get the ipv6_addresses field of the given VIF.

Signature:

string set get_ipv6_addresses (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string set

value of the field

RPC name: get_ipv6_allowed

Overview:

Get the ipv6_allowed field of the given VIF.

Signature:

string set get_ipv6_allowed (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string set

value of the field

RPC name: get_ipv6_configuration_mode

Overview:

Get the ipv6_configuration_mode field of the given VIF.

Signature:

vif_ipv6_configuration_mode get_ipv6_configuration_mode (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: vif_ipv6_configuration_mode

value of the field

RPC name: get_ipv6_gateway

Overview:

Get the ipv6_gateway field of the given VIF.

Signature:

string get_ipv6_gateway (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_locking_mode

Overview:

Get the locking_mode field of the given VIF.

Signature:

vif_locking_mode get_locking_mode (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: vif_locking_mode

value of the field

RPC name: get_MAC

Overview:

Get the MAC field of the given VIF.

Signature:

string get_MAC (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_MAC_autogenerated

Overview:

Get the MAC_autogenerated field of the given VIF.

Signature:

bool get_MAC_autogenerated (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: bool

value of the field

RPC name: get_metrics

This message is removed.

Overview:

Get the metrics field of the given VIF.

Signature:

VIF_metrics ref get_metrics (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: VIF_metrics ref

value of the field

RPC name: get_MTU

Overview:

Get the MTU field of the given VIF.

Signature:

int get_MTU (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: int

value of the field

RPC name: get_network

Overview:

Get the network field of the given VIF.

Signature:

network ref get_network (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: network ref

value of the field

RPC name: get_other_config

Overview:

Get the other_config field of the given VIF.

Signature:

(string -> string) map get_other_config (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: (string -> string) map

value of the field

RPC name: get_qos_algorithm_params

Overview:

Get the qos/algorithm_params field of the given VIF.

Signature:

(string -> string) map get_qos_algorithm_params (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: (string -> string) map

value of the field

RPC name: get_qos_algorithm_type

Overview:

Get the qos/algorithm_type field of the given VIF.

Signature:

string get_qos_algorithm_type (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_qos_supported_algorithms

Overview:

Get the qos/supported_algorithms field of the given VIF.

Signature:

string set get_qos_supported_algorithms (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string set

value of the field

RPC name: get_record

Overview:

Get a record containing the current state of the given VIF.

Signature:

VIF record get_record (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: VIF record

all fields from the object

RPC name: get_runtime_properties

Overview:

Get the runtime_properties field of the given VIF.

Signature:

(string -> string) map get_runtime_properties (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: (string -> string) map

value of the field

RPC name: get_status_code

Overview:

Get the status_code field of the given VIF.

Signature:

int get_status_code (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: int

value of the field

RPC name: get_status_detail

Overview:

Get the status_detail field of the given VIF.

Signature:

string get_status_detail (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_uuid

Overview:

Get the uuid field of the given VIF.

Signature:

string get_uuid (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_VM

Overview:

Get the VM field of the given VIF.

Signature:

VM ref get_VM (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object

Minimum Role: read-only

Return Type: VM ref

value of the field

RPC name: move

Overview:

Move the specified VIF to the specified network, even while the VM is running

Signature:

void move (session ref session_ref, VIF ref self, network ref network)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF to move
network ref network The network to move it to

Minimum Role: vm-admin

Return Type: void

RPC name: plug

Overview:

Hotplug the specified VIF, dynamically attaching it to the running VM

Signature:

void plug (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF to hotplug

Minimum Role: vm-admin

Return Type: void

RPC name: remove_from_other_config

Overview:

Remove the given key and its corresponding value from the other_config field of the given VIF. If the key is not in that Map, then do nothing.

Signature:

void remove_from_other_config (session ref session_ref, VIF ref self, string key)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object
string key Key to remove

Minimum Role: vm-admin

Return Type: void

RPC name: remove_from_qos_algorithm_params

Overview:

Remove the given key and its corresponding value from the qos/algorithm_params field of the given VIF. If the key is not in that Map, then do nothing.

Signature:

void remove_from_qos_algorithm_params (session ref session_ref, VIF ref self, string key)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object
string key Key to remove

Minimum Role: vm-admin

Return Type: void

RPC name: remove_ipv4_allowed

Overview:

Removes an IPv4 address from this VIF

Signature:

void remove_ipv4_allowed (session ref session_ref, VIF ref self, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF from which the IP address will be removed
string value The IP address which will be removed from the VIF

Minimum Role: pool-operator

Return Type: void

RPC name: remove_ipv6_allowed

Overview:

Removes an IPv6 address from this VIF

Signature:

void remove_ipv6_allowed (session ref session_ref, VIF ref self, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF from which the IP address will be removed
string value The IP address which will be removed from the VIF

Minimum Role: pool-operator

Return Type: void

RPC name: set_ipv4_allowed

Overview:

Set the IPv4 addresses to which traffic on this VIF can be restricted

Signature:

void set_ipv4_allowed (session ref session_ref, VIF ref self, string set value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF which the IP addresses will be associated with
string set value The IP addresses which will be associated with the VIF

Minimum Role: pool-operator

Return Type: void

RPC name: set_ipv6_allowed

Overview:

Set the IPv6 addresses to which traffic on this VIF can be restricted

Signature:

void set_ipv6_allowed (session ref session_ref, VIF ref self, string set value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF which the IP addresses will be associated with
string set value The IP addresses which will be associated with the VIF

Minimum Role: pool-operator

Return Type: void

RPC name: set_locking_mode

Overview:

Set the locking mode for this VIF

Signature:

void set_locking_mode (session ref session_ref, VIF ref self, vif_locking_mode value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF whose locking mode will be set
vif_locking_mode value The new locking mode for the VIF

Minimum Role: pool-operator

Return Type: void

RPC name: set_other_config

Overview:

Set the other_config field of the given VIF.

Signature:

void set_other_config (session ref session_ref, VIF ref self, (string -> string) map value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object
(string -> string) map value New value to set

Minimum Role: vm-admin

Return Type: void

RPC name: set_qos_algorithm_params

Overview:

Set the qos/algorithm_params field of the given VIF.

Signature:

void set_qos_algorithm_params (session ref session_ref, VIF ref self, (string -> string) map value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object
(string -> string) map value New value to set

Minimum Role: vm-admin

Return Type: void

RPC name: set_qos_algorithm_type

Overview:

Set the qos/algorithm_type field of the given VIF.

Signature:

void set_qos_algorithm_type (session ref session_ref, VIF ref self, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self reference to the object
string value New value to set

Minimum Role: vm-admin

Return Type: void

RPC name: unplug

Overview:

Hot-unplug the specified VIF, dynamically unattaching it from the running VM

Signature:

void unplug (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF to hot-unplug

Minimum Role: vm-admin

Return Type: void

RPC name: unplug_force

Overview:

Forcibly unplug the specified VIF

Signature:

void unplug_force (session ref session_ref, VIF ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VIF ref self The VIF to forcibly unplug

Minimum Role: vm-admin

Return Type: void

Class: VIF

In this article