LinuxQuestions.org
Visit Jeremy's Blog.
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 04-01-2016, 09:35 AM   #1
ipsl
LQ Newbie
 
Registered: Apr 2016
Posts: 3

Rep: Reputation: Disabled
Rebooting KVM host looses it's guest.


Running ubuntu 14.04 for the entire stack.

The host machine has 4 drives:
sda 64GB SSD (Main OS)
sdb 64GB SSD (dd copy of sda)
sdc 1.2 TB SSD (1st guest)
sdd 1.2 TB SSD (2nd guest)


When the host machine reboots I will sometimes loose the connection to the guest VM

Code:
tsadmin@lw-kvm-00:~$ virsh -c qemu:///system list
 Id    Name                           State
----------------------------------------------------

tsadmin@lw-kvm-00:~$
but the XML files are there

Code:
tsadmin@lw-kvm-00:~$ ls -l /etc/libvirt/qemu/
total 16
drwxr-xr-x 2 root root 4096 Mar 31 13:38 autostart
-rw------- 1 root root 2760 Apr  1 07:10 lkr-test-elastic00.xml
-rw------- 1 root root 2760 Mar 31 12:59 lkr-test-elastic01.xml
drwxr-xr-x 3 root root 4096 Mar 31 11:58 networks
if I try to redefine using the xml

Code:
tsadmin@lw-kvm-00:~$ sudo virsh define /etc/libvirt/qemu/lkr-test-elastic00.xml
error: Failed to define domain from /etc/libvirt/qemu/lkr-test-elastic00.xml
error: unknown OS type hvm

tsadmin@lw-kvm-00:~$
The xml file

Code:
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit lkr-test-elastic00
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>lkr-test-elastic00</name>
  <uuid>e6da59a7-708b-0bf1-5642-bf43200b6011</uuid>
  <memory unit='KiB'>32768000</memory>
  <currentMemory unit='KiB'>32768000</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/sdc1'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:e9:1d:79'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='bridge'>
      <mac address='52:54:00:de:ac:69'/>
      <source bridge='br1'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </sound>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Each guest is an entire 1.2TB drive. About the only thing I can think of is doing the dd to clone the host hard drive, but how or why is beyond me.
 
Old 04-03-2016, 06:14 AM   #2
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
virsh list will only show the running VMs. On reboot, is a VM is not set to autostart, it will stay down until you start it. virsh list --all, will give you all the defined VMs, so you can start the ones that are down. or you can do virsh autostart VMNAME to set it to autostart on host boot
 
Old 04-04-2016, 08:47 AM   #3
ipsl
LQ Newbie
 
Registered: Apr 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
tsadmin@lw-kvm-00:~$ virsh list --all
Id Name State
----------------------------------------------------
The system doesn't see them, but the data in the harddrives is there and the xml files are also there and set in the auto-start directory.

Quote:
tsadmin@lw-kvm-00:~$ ls -l /etc/libvirt/qemu/autostart/
total 0
lrwxrwxrwx 1 root root 40 Mar 31 13:38 lkr-test-elastic00.xml -> /etc/libvirt/qemu/lkr-test-elastic00.xml
lrwxrwxrwx 1 root root 40 Mar 31 13:38 lkr-test-elastic01.xml -> /etc/libvirt/qemu/lkr-test-elastic01.xml
 
Old 04-05-2016, 06:35 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
How do you start them then? Or are you saying that all is not working?

It is possible that the filesystem is not behaving well on shutdowns. When you say reboot, do you have all clients properly shut down?

I might start with a live media and do a file system check.
 
Old 04-06-2016, 07:41 AM   #5
ipsl
LQ Newbie
 
Registered: Apr 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
I could build the host, install and configure kvm. Create several guest via virt-manager, set the guest to autostart, and dd the host disk. This would work, then on a reboot, it wouldn't.

At this point my boss said to blow it out and throw ESXi on them so not only was it frustrating, it's now moot. :/
 
Old 04-06-2016, 10:16 AM   #6
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 528

Rep: Reputation: 272Reputation: 272Reputation: 272
Looks like kvm kernel module might not be loading after reboot, for some reason.

But since you gave up (or were forced to give up), we will never know why.
Please mark this thread as "Solved".
 
Old 04-07-2016, 09:28 AM   #7
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
Nothing to do with the kernel module. If libvirt failed to locate the files after reboot, you probably had a permissions or SELinux misconfiguration. Never happened to me, but then again, I am smart enough not to use ubuntu for KVM
 
Old 04-08-2016, 02:45 AM   #8
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 528

Rep: Reputation: 272Reputation: 272Reputation: 272
Quote:
Originally Posted by ipsl View Post
if I try to redefine using the xml

Code:
tsadmin@lw-kvm-00:~$ sudo virsh define /etc/libvirt/qemu/lkr-test-elastic00.xml
error: Failed to define domain from /etc/libvirt/qemu/lkr-test-elastic00.xml
error: unknown OS type hvm

tsadmin@lw-kvm-00:~$
This looks like a missing kvm kerlel module.
Even if livbirt 'forgot' where the file is, here the OP is specifically telling it where to find it and to define a new VM with it...

But since the OP will not pursue further info we'll never know.
 
  


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
Presenting logical volume from host to KVM guest. Partition within guest? batfastad Linux - Server 2 07-27-2015 03:53 PM
Redirect logs from KVM guest to KVM host essential1 Linux - Virtualization and Cloud 2 10-08-2013 03:29 PM
accessing a KVM guest from outside the host rootaccess Linux - General 2 04-27-2013 11:29 PM
KVM guest cannot access host thehemi Linux - Virtualization and Cloud 8 03-28-2012 04:36 AM
ubuntu move kvm guest from one host to another thllgo Linux - Software 1 04-18-2011 06:12 PM

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

All times are GMT -5. The time now is 02:35 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