LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 09-13-2012, 08:47 AM   #1
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Rep: Reputation: Disabled
How do I issue a "power off" through using virsh?


When I use virt-manager, I can right-click on a VM and issue a "force off" command to power off the VM. This is essentially the same as a Linux "halt -p" command. I do not see a command for this provided by virsh. There is a shutdown command, but in my experience this does not in fact shut down the VM--I can still connect to the VM afterwards.

What's the solution?
 
Old 09-13-2012, 08:52 AM   #2
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
Found it. It appears that the virsh command "destroy" does what I want. Not exactly intuitive but it works...
 
Old 09-13-2012, 01:02 PM   #3
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
virsh shutdown will initiate a poweroff. destroy is the equivalent of pulling the power lead
 
Old 09-13-2012, 03:14 PM   #4
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
I my own tests, the shutdown command doesn't do anything. My VMs do not even shutdown, let alone power off. When issued, the command reports that the domain is being shutdown, but I've waited for extended periods and nothing happens.

Is there some configuration setting I need?
 
Old 09-16-2012, 02:33 AM   #5
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
virsh shutdown sends an ACPI shutdown to the guest. If you have no ACPI awareness in the guest, it will not work. Also, sometimes the guest gets the shutdown request and pops up an "are you sure?" messgae, which you can't see from the host, and it looks like shutdown didn't work
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[solved] Hardware issue (?) after power outage, "Kernel panic [...]" help_please Linux - Hardware 1 07-30-2011 02:20 AM
Which "power distro" for lots of customizing and good system power management? mothergoose729 Linux - Distributions 11 11-18-2009 09:11 PM
"Another power manager is already running" Xfce issue johnnyxxxcakes Linux - Newbie 3 06-25-2009 01:55 AM
Disabling hardware detection of "reboot" and "power" buttons Sabinou Linux - General 3 08-21-2006 07:03 PM
What "kernel opts" allow PC to power down with "turning energy off"? kornerr Linux - General 1 03-10-2005 12:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 11:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration