HP DL385 XenServer Software Development Kit Guide 4.1.0

HP DL385 - ProLiant - G5 Manual

HP DL385 manual content summary:

  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 1
    XenServer Software Development Kit Guide 4.1.0 Published March 2008 1.0 Edition 1
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 2
    Development Kit Guide: Release 4.1.0 Published March 2008 Copyright © 2008 Citrix Systems, Inc. Xen®, Citrix™, Enterprise Edition™, XenServer™, Express Edition™, XenCenter™ and logos are either registered trademarks or trademarks of Citrix Systems, Inc. in the United States and/or other countries
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 3
    XenServer Software Development Kit Guide 3
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 4
    Working with VIFs and VBDs 9 3.3.1. Creating disks and attaching them to VMs 9 3.3.2. Creating and attaching Network Devices to VMs 11 3.3.3. Host configuration for networking and storage 11 3.4. Exporting and Importing VMs 12 3.5. Where to look next 13 4. Using the API ...14 4.1. Anatomy of
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 5
    XenServer Software Development Kit Guide 5.2.4. CentOS 4.5/5.0 27 5.3. Adding Xenstore entries to VMs 27 5.4. Security enhancements 27 5.5. Advanced settings for network interfaces 28 5.5.1. ethtool settings 28 5.5.2. Miscellaneous settings 29 5.6. Internationalization for
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 6
    List of Figures 3.1. Graphical overview of API classes for managing VMs, Hosts, Storage and Networking ...9 3.2. A VM object with 2 associated VDIs 11 6
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 7
    Chapter 1. Introduction Welcome to the developer's guide for XenServer. Here you will find the information you need in order to understand and use the Software Development Kit (SDK) that XenServer provides. This information will provide you with some of the architectural background and thinking that
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 8
    /. Please refer to the XenServer Installation Guide for detailed instructions on how to set up your development tab of the SDK VM and inspect the networking configuration. If the SDK is to be accessed remotely, then the first version of a supported Software Development Kit that Citrix has published.
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 9
    language bindings, as well as the C language samples that are included as part of the SDK VM. 2.7. Building Samples for the Windows Platform The C# 2.9. Accessing SDK reference The SDK VM has a built-in web server that allows access to the samples and the complete reference documentation.
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 10
    Getting Started 3. From any other machine, fire up a web browser and type http:/// The full URL you need is also displayed in the "Message of the Day" in the SDK VM console after it has completed booting. 4
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 11
    , storage, networking, host configuration and pools. Performance and status completes, the result (or error code) is available via the Access: The XML-RPC API server executing on the host accepts without reference to code in any specific language; at supported guest types. (If you want to see a quick 5
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 12
    : that detail is dealt with by our language-specific API bindings and described concretely in the following chapter to "Debian Etch 4.0" (one of the default Linux templates supplied with XenServer). 3.1.3. Installing the VM based on a template server-side memory used to store the session object. 6
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 13
    applications (note that sessions can be used across multiple separate client-server network connections) and then explicitly logout when possible. 3.1.6. "Install and presentation; the textual description in subsequent sections, and the code-sample walk through in the next Chapter will help make
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 14
    . Example fields include "type" (which determines the storage-specific driver a XenServer installation uses to read/write the SR's VDIs are finding this enumeration of classes rather terse may wish to skip to the code walk-throughs of the next chapter: there are plenty of useful applications that can
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 15
    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 described in the previous section, and had the server return its reference to us.) We will also assume that we have authenticated
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 16
    to VMs in a read-only fashion. (Attempting to attach a VDI with its read_only field set to true in a read/write fashion results in error.) Invoking the VDI.create call causes the XenServer installation to create a blank disk image on physical storage, create an associated VDI object (the datamodel
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 17
    the API object-model; instead we will use this section just to outline briefly the symmetry between virtual networking device and virtual storage device configuration. The networking analogue of the VBD class is the VIF class. Just as a VBD is the API representation of a block device inside a VM
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 18
    -backend-driver, containing the low-level parameters required to configure the physical storage device(s) on which the SR is to be realized. The specific contents needs to mount the directory "/scratch/mysrs/sr1" on the NFS server named "my_nfs_server.example.com." Like VBD objects, PBD objects also
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 19
    to destroy the VM if a checksum error is detected) The reference of an the metadata, use the URI http://server/import_metadata 3.5. Where to look next In you to start reading the code samples of the next chapter and find more information: • The Administrators Guide contains an overview of the xe
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 20
    code fragments are given in python syntax but equivalent code can be used from services running directly on the supply a valid reference will result in a SESSION_INVALID error being returned. A session reference is acquired by supplying is updated on every API call. The server software currently
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 21
    Using the API • Remember to log out of active sessions to avoid leaking them; and • Be prepared to log in again to the server if a SESSION_INVALID error is caught. In the following fragment a connection via the Unix domain socket is established and a session created: import XenAPI session = XenAPI.
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 22
    or failed; • progress in the range 0-1; and • the result or error code returned by the operation. An application which wanted to track the progress is modified the server generates an event. Clients can subscribe to this event stream on a per-class basis and receive updates rather than resorting to
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 23
    server is of finite length a very slow client might fail to read the events fast enough; if this happens an EVENTS_LOST error The SDK includes language bindings and example code for the C, C# and python programming xen_vm.h. C binding dependencies Platform supported: Library: Linux The language binding
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 24
    file VM.cs. C# binding dependencies Platform supported: Windows with .NET version 2.0 Library: be able to communicate with the xml-rpc server. Two simple examples are included with the VM from one template, configures the name and description of the VM before finally power-cycling the VM; and
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 25
    raw XML-RPC or one of the supplied language bindings, third-party software developers xe.exe. CLI dependencies Platform supported: Linux and Windows Library: in Chapter 5 of the XenServer Administrator's Guide. The SDK contains 3 example bash shell The application source code is contained within
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 26
    commandline arguments containing a server URL, username, password : finally: to make sure the program logs out of its session at the end. if __name__ == "__main__": if len(sys.argv) 5: print "Usage care to filter out control domains (which are part of the system and not controllable by the user
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 27
    Using the API # use a rotation as a permutation hosts = [hosts[-1]] + hosts[:(len(hosts)-1)] Each VM is then moved via XenMotion to the new host under this rotation (i.e. a VM running on host at position 2 in the list will be moved to the host at position 1 in the list etc.) In order to execute each
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 28
    -> %s [ status: %s; result = %s; error = %s ]" % \ (record["uuid"], record care to shut it down first if it is powered on. The example begins with some boilerplate which first on the current path. Next the script prompts the user for a server name, username and password: # Allow the path to the '
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 29
    $? -ne 0 ]; then echo "error: no vm uuid \"${vmuuid}\" found" exit 2 fi The script then checks the power state of the VM and if it is running, it attempts a clean shutdown. The event system is used to wait for the VM to enter state "Halted". Note The XE CLI supports
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 30
    life-cycles of Virtual Machines, and offers a lot of flexibility in the way that XenAPI providers may implement specific . XenServer provides a utility (called vncterm) to Linux distributions often configure VNC within the minimum version which viewers must support. 5.1.1. Retrieving VNC consoles
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 31
    is complete, the connection can subsequently directly be used as a VNC server without any further HTTP protocol action. This scheme requires direct access from ( RO): https://192.168.0.1/console?ref=(...) Use command-line utilities like ping to test connectivity to the IP address provided in
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 32
    xen/bin/xenconsole domid This configuration is an advanced procedure, end, a special bootloader known as eliloader is present in the control domain which reads various other_config keys in the VM record at start time and performs distribution-specific it removes the additional updates disk from the VM
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 33
    XenServer API extensions The network retrieval enables users to install the upstream Red Hat vendor kernel directly from their network repository. An updated XenServer kernel is also provided on the xs-tools.iso built-in ISO image which fixes various Xen-related bugs. 5.2.3. SUSE Enterprise Linux 10
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 34
    Some privileged commands are naturally hard to restrict (e.g. the ability to limited to prevent malicious guests from causing a denial of service on the control domain. This is implemented as a 5.5.1. ethtool settings Developers might wish to configure custom ethtool settings for physical and virtual
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 35
    XenServer API extensions For example, to enable TX checksumming on a virtual NIC via the xe CLI: xe vif-param-set uuid= other-config:ethtool-tx="on" or: xe vif-param-set uuid= other-config:ethtool-tx="true" To set the duplex setting on a physical NIC to half duplex via the xe CLI
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 36
    XenServer API extensions • local-storage • xenserver-tools Additionally, other_config["i18n-original-value-"] gives the value of that field when the SR was created. If XenCenter sees a record where SR.name_label equals other_config["i18n-original-value-name_label"] (that is, the record
  • HP DL385 | XenServer Software Development Kit Guide 4.1.0 - Page 37
    Index 31
  • 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

1
XenServer Software Development Kit
Guide
4.1.0
Published March 2008
1.0 Edition