Contents

VZNetworkBlockDeviceStorageDeviceAttachment

A storage device attachment backed by a Network Block Device (NBD) client.

Declaration

class VZNetworkBlockDeviceStorageDeviceAttachment

Overview

This storage device attachment provides a Network Block Device (NBD) client implementation. The NBD client connects to an NBD server referred to by an NBD Uniform Resource Indicator (URI), represented as an URL in this API. The NBD server runs outside of and isn’t controlled by the Virtualization framework. The NBD client forwards the guest’s I/O operations to the NBD server, which handles the I/O operations.

The NBD client attempts to connect to the NBD server referred to by the URL used when you started the VM with start(). However, it’s important to note that a connection attempt isn’t made when the framework initializes the attachment object.

Reconnection attempts take place throughout the life cycle of the VM when the NBD client encounters a recoverable error such as connection timeout and unexpected connection errors. The NBD client disconnects from the server when the VM shuts down.

Using this attachment requires the app to have the com.apple.security.network.client entitlement because this attachment opens an outgoing network connection.

To create a device that uses an NBD service, first initialize a VZNetworkBlockDeviceStorageDeviceAttachment with the URI of an NBD server, then use the attachment to configure a VZStorageDeviceConfiguration as shown in the example below (the attachment works with any subclass of VZStorageDeviceConfiguration, not just VZVirtioBlockDeviceConfiguration):

For more information about Network Block Devices, see the Network Block Device Specification on GitHub.

For more information about the NBD URL format, see the Network Block Device URL specification on GitHub.

Topics

Creating network block device attachments

Validating a network block device’s URL

Getting information about the attachment point

Observing changes to the network block device

Initializers

See Also

Attachment points