[Users] Fwd: Regarding Python script for RHEVM

Tim Hildred thildred at redhat.com
Fri Oct 26 00:34:43 UTC 2012


Hey Romil,

You could also check out the RHEV Developer Guide here:
https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Virtualization/3.1-Beta/html-single/Developer_Guide/index.html

It is a beta version of the guide, but will be updated when RHEV 3.1 GAs. It is written for RHEV, but there should be enough overlap for it to be helpful to you. 

Tim Hildred, RHCE
Content Author II - Engineering Content Services, Red Hat, Inc.
Brisbane, Australia
Email: thildred at redhat.com
Internal: 8588287
Mobile: +61 4 666 25242
IRC: thildred

----- Original Message -----
> From: "Michael Pasternak" <mpastern at redhat.com>
> To: romilgupta19 at gmail.com
> Cc: "Mike Burns" <mburns at redhat.com>, users at ovirt.org
> Sent: Friday, October 26, 2012 12:26:51 AM
> Subject: Re: [Users] Fwd:  Regarding Python script for RHEVM
> 
> Hi,
> 
> VM object has methods representing api actions, use them to
> manipulate
> vm state as you need (note: you can see permitted argument/s for the
> given
> method in method's __doc__)
> 
> On 10/23/2012 08:40 AM, Itamar Heim wrote:
> > 
> > 
> > 
> > -------- Original Message --------
> > Subject:     [Users] Regarding Python script for RHEVM
> > Date:     Mon, 22 Oct 2012 21:09:22 +0530
> > From:     Romil Gupta <romilgupta19 at gmail.com>
> > To:     users at ovirt.org, mburns at redhat.com
> > 
> > 
> > 
> > 
> > Hello ,
> > 
> > I am having a Rhel6.2 machine over tht i have installed  ovirt-sdk
> > using
> > following command :
> > 
> > $ git clone http://gerrit.ovirt.org/ovirt-engine-sdk
> > <http://gerrit.ovirt.org/ovirt-engine-sdk>
> > $ yum install -y rpm-build python-devel python-setuptools
> > $ make rpm
> > $ yum localinstall
> > rpmtop/RPMS/noarch/ovirt-engine-sdk-x.y-z.noarch.rpm
> > 
> > 
> > thn i have written python script rhevmtest.py :
> > 
> > 
> > from ovirtsdk.api import API
> > from ovirtsdk.xml import params
> > import time
> > 
> > rhevm_uri = "https://rhevm301.vmm.hp.com:8443/api"
> > rhevm_username = "admin at rhevm301.vmm.hp.com
> > <mailto:admin at rhevm301.vmm.hp.com>"
> > rhevm_password = "iso*help"
> > 
> > 
> > rhevmAPI = API(url=rhevm_uri, username=rhevm_username,
> > password=rhevm_password)
> > 
> > print "Connected to RHEVM Successful"
> > 
> > instances  = rhevmAPI.vms.list()
> > cluster = rhevmAPI.clusters.get(name='Default')
> > 
> > template = rhevmAPI.templates.get(name='CentOS')
> > 
> > param = params.VM(name= 'test_vm'
> > ,cluster=cluster,template=template,memory=2147483648)
> > vm6 = rhevmAPI.vms.add(param)
> > 
> > and its working fine :)
> > 
> > Now can give me some guidance to write script for following
> > functions:
> > 
> > •pause                                 (Pause a running vm)
> > 
> > •Unpause                             (UnPause a vm)
> > 
> > •start                                       (start a vm from
> > shutdown
> > state)
> > 
> > •shutdown                                (shutdown a vm)
> > 
> > •stop                                          (Poweroff the vm)
> > 
> > *. *     snapshot/ create template         (take snapshot of a vm)
> > •live-migration                          (Migrates a running vm to
> > a new
> > machine)
> > 
> > •resize                                   (Resize a vm)
> > 
> > •resize-confirm                    (Confirm a previous vm)
> > 
> > •resize-revert                       Revert a previous resize (and
> > return to the previousVM)
> > 
> > 
> > 
> > Regards,
> > Romil Gupta
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> --
> 
> Michael Pasternak
> RedHat, ENG-Virtualization R&D
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 



More information about the Users mailing list