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.
rushdhi, xm top xm list xm info thanks, walter -----Original Message----- From: xen-users-bounces@lists.xen.org [mailto:xen-users-bounces@lists.xen.org] On Behalf Of Rushdhi Mohamed Sent: Freitag, 2. März 2012 10:04 To: xen-users@lists.xensource.com 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@lists.xen.org http://lists.xen.org/xen-users
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@gmail.com> wrote:> rushdhi,
>
> xm top
> xm list
> xm info
>
> thanks, walter
>
>
> -----Original Message-----
> From: xen-users-bounces@lists.xen.org
> [mailto:xen-users-bounces@lists.xen.org] On Behalf Of Rushdhi Mohamed
> Sent: Freitag, 2. März 2012 10:04
> To: xen-users@lists.xensource.com
> 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@lists.xen.org
> http://lists.xen.org/xen-users
>
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@gmail.com]
Sent: Freitag, 2. März 2012 16:21
To: Walter Robert Ditzler; xen-users@lists.xensource.com
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@gmail.com>
wrote:> rushdhi,
>
> xm top
> xm list
> xm info
>
> thanks, walter
>
>
> -----Original Message-----
> From: xen-users-bounces@lists.xen.org
> [mailto:xen-users-bounces@lists.xen.org] On Behalf Of Rushdhi Mohamed
> Sent: Freitag, 2. März 2012 10:04
> To: xen-users@lists.xensource.com
> 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@lists.xen.org
> http://lists.xen.org/xen-users
>