HP BL680c XenServer Software Development Kit Guide 4.1.0 - Page 15

Working with VIFs and VBDs, 3.3.1. Creating disks and attaching them to VMs

Page 15 highlights

Overview of the XenServer API PBD A PBD (Physical Block Device) object represents an attachment between a Host and a SR (Storage Repository) object. Fields include "currentlyattached" (which specifies whether the chunk of storage represented by the specified SR object) is currently available to the host; and "device_config" (which specifies storage-driver specific parameters that determines how the low-level storage devices are configured on the specified host -- e.g. in the case of an SR rendered on an NFS filer, device_config may specify the host-name of the filer and the path on the filer in which the SR files live.) Figure 3.1. Graphical overview of API classes for managing VMs, Hosts, Storage and Networking Figure 3.1, "Graphical overview of API classes for managing VMs, Hosts, Storage and Networking" presents a graphical overview of the API classes involved in managing VMs, Hosts, Storage and Networking. From this diagram, the symmetry between storage and network configuration, and also the symmetry between virtual machine and host configuration is plain to see. 3.3. Working with VIFs and VBDs In this section we walk through a few more complex scenarios, describing informally how various tasks involving virtual storage and network devices can be accomplished using the API. 3.3.1. Creating disks and attaching them to VMs Let's start by considering how to make a new blank disk image and attach it to a running VM. We will assume that we already have ourselves a running VM, and we know its corresponding API object reference (e.g. we may have created this VM using the procedure described in the previous section, and had the server return its reference to us.) We will also assume that we have authenticated with the XenServer installation 9

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

Overview of the XenServer API
9
PBD
A PBD (
Physical Block Device
) object represents an attachment between
a Host and a SR (Storage Repository) object. Fields include "currently-
attached" (which specifies whether the chunk of storage represented
by the specified SR object) is currently available to the host; and
"device_config" (which specifies storage-driver specific parameters that
determines how the low-level storage devices are configured on the specified
host -- e.g. in the case of an SR rendered on an NFS filer, device_config may
specify the host-name of the filer and the path on the filer in which the SR files
live.)
Figure 3.1. Graphical overview of API classes for managing VMs, Hosts, Storage
and Networking
Figure 3.1, “Graphical overview of API classes for managing VMs, Hosts, Storage and Networking” presents
a graphical overview of the API classes involved in managing VMs, Hosts, Storage and Networking. From
this diagram, the symmetry between storage and network configuration, and also the symmetry between
virtual machine and host configuration is plain to see.
3.3. Working with VIFs and VBDs
In this section we walk through a few more complex scenarios, describing informally how various tasks
involving virtual storage and network devices can be accomplished using the API.
3.3.1. Creating disks and attaching them to VMs
Let's start by considering how to make a new blank disk image and attach it to a running VM. We will assume
that we already have ourselves a running VM, and we know its corresponding API object reference (e.g.
we may have created this VM using the procedure described in the previous section, and had the server
return its reference to us.) We will also assume that we have authenticated with the XenServer installation