[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] xm domstate command not found



hi rushdhi,

that's my solution, one of millions:

***
#!/bin/sh

$VMS = vm1 vm2 vm3
$VM_STATE = ""

for vms in $VMS
do
  xm shutdown $vms;
done

for vms in $VMS
do
  $VM_STATE=`xm uptime $vms -s`;

  if [ -n "$VM_STATE" ]
  then
    xm destroy $vms;
  fi
done
***

it only check after the shut down if any vm are still running and destroy
then at the end

walter.

-----Original Message-----
From: Rushdhi Mohamed [mailto:zmrushdhi@xxxxxxxxx] 
Sent: Freitag, 2. März 2012 16:21
To: Walter Robert Ditzler; xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] xm domstate command not found

walter,

thanks for d reply,

but how can i use it in a script.

this is my script to shutoff vms before the backup
----------------------------------

#stop VMS

$VMS = vm1 vm2 vm3... etc"
        echo "Bringing Down the VMs"
        
        for vms in $VMS
        do
                xm shutdown $vms
        done

        for vms in $VMS
        do
                echo -n -e "\t\t$vms : "
                #xm shutdown $vms
                #wait until shutdown or wait 1min
                COUNTER=0
                while [  $COUNTER -lt 60 ]; do
                        /////****here i wont to check whether the VM status,
whether runnig or shutoff
                        if [ its down]; then
                                echo "ITS Down"
                                break
                        fi
                        sleep 1
                        let COUNTER=COUNTER+1
                done

                /////****here again i wont to check whether the VM status,
whether runnig or shutoff
                if [ if its still runnig destroy ]; then
                        xm destroy $vms
                        sleep 3
                fi


so how can i check the vm status to use in this code...

any help is appreciated.

thanks, rushdhi..
On Fri, Mar 2, 2012 at 3:19 PM, Walter Robert Ditzler <ditwal001@xxxxxxxxx>
wrote:
> rushdhi,
>
> xm top
> xm list
> xm info
>
> thanks, walter
>
>
> -----Original Message-----
> From: xen-users-bounces@xxxxxxxxxxxxx
> [mailto:xen-users-bounces@xxxxxxxxxxxxx] On Behalf Of Rushdhi Mohamed
> Sent: Freitag, 2. März 2012 10:04
> To: xen-users@xxxxxxxxxxxxxxxxxxx
> Subject: [Xen-users] xm domstate command not found
>
> hi alll..
>
>
> i want to find the xen domain's state using    xm domstate  command,
>
> domstate command works fine inside virish but when i try with xm like
>  [xm domestate VM_NAME] its giving an error saying subcomand domestate 
> not found.
>
> i just want to shutoff the xen virtual domains using a scrip to take
backup.
> so i just want to make sure that the domain are shutdown successfully  
> after the xm shutdown command.
>
> can anyone help me pls.
>
> thanks in Advance.
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxx
> http://lists.xen.org/xen-users
>


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.