- COPYRIGHT AND LICENSE
Xen::API Perl interface to the Xen RPC-XML API.
use Xen::API; my $x = Xen::API->new; my %vms = $x->list_vms my %templates = $x->list_templates my $vm = $x->create_vm(template=>'my_template',cpu=>4,memory=>'16G',vmname=>'this_vm'); my $vm_records = $x->Xen::API::VM::get_all_records();
Perl interface to the Xen RPC-XML API. Contains some shortcuts for creating, destroying, importing, and exporting VMs. All RPC API commands are available in the Xen::API:: package space. Simply replace the dots with :: and prepend Xen::API:: to the command, and execute it as if it were a perl function. Be sure to pass the Xen object as the first parameter.
Display a password prompt.
Convert suffix notation (k, M, G) to byte count. Useful for writing memory to give to VM.
shortcuts for RPC::XML explicit typecasts
Create a new instance of a Xen class.
New Xen instance.
Create a new VM.
Arguments: - vmname - The xen name of the VM. - template - The template to base the VM from. - cpu - How many CPUs to assign - memory - How much memory to assign
Returns a ref to the newly created VM.
Run a remote script on a VM guest over SSH.
Arguments: - script - Remote script file to run on the guest via SSH - vmname - Name of the VM where the script should be run - user - SSH user name for running a remote command on the guest - password - SSH password for running a remote command on the guest - port - SSH port for running a remote command on the guest - sudo - Should sudo be used to run a remote command on the guest?
Gets the IP address of a VM.
Destroys a VM and its associated VDIs.
Import a VM from a xva file.
Export a VM to a xva file.
Transfer a VM from one xen server to another without creating an intermediate file.
Set the is_a_template flag for a VM.
List the VMs on this Xen server.
List the templates on this Xen server.
List the physical hosts and related information.
Ben Booth, email@example.com
Copyright (C) 2013 by Ben Booth
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.