[virt-tools-list] setting memory at runtime fails?

Thomas Fjellstrom tfjellstrom at shaw.ca
Fri Aug 20 06:24:55 UTC 2010


On August 10, 2010, you wrote:
> On 08/10/2010 01:06 AM, Thomas Fjellstrom wrote:
> > On August 9, 2010, Cole Robinson wrote:
> >> On 08/08/2010 02:57 AM, Thomas Fjellstrom wrote:
> >>> Hi,
> >>> 
> >>> I've tried on several occasions to use the virt-manager to set memory
> >>> in a guest at run time, but all it seems to do is set memory in the
> >>> guest to a very small amount regardless of what number I actually
> >>> chose (trying to use a number in KB doesn't work, the gui seems to
> >>> have issues with it. it'll set the max mem, but trying to set mem to
> >>> anything that large will just make it go back to the previous
> >>> allocation).
> >>> 
> >>> I just tried it again with virt-manager, memory was set to 256M, I
> >>> told it to increase to 512MB, and it instantly dropped to 70MB and
> >>> the guest OOMKilled every process. Then I forced the guest off, then
> >>> tried to restart it and virt-manager decided to say it was going to
> >>> set the memory to 1024MB, then crash. Though it did start the guest,
> >>> but only with the 512MB I increased it to in the last step.
> >>> 
> >>> virsh seems to work fine to reduce the memory in a vm. I did notice
> >>> that virsh takes KB and virt-manager takes MB. Is it possible that
> >>> virt-manager isn't doing the necessary conversion to KB when calling
> >>> into libvirt?
> >> 
> >> More info is really required here: versions for virt-manager,
> >> virtinst, libvirt, and qemu or xen depending on what you are using.
> >> If you can provide the output of virt-manager --debug when
> >> reproducing this series of events it would help track down the issue.
> > 
> > libvirt-bin 0.8.2-1
> > virt-manager 0.8.4-7
> > virtinst 0.500.3-2
> > 
> > qemu 0.12.5
> > qemu-kvm 0.12.4+
> > linux 2.6.34.1
> > 
> > I've attached a log of the --debug output of virt-manager for a session
> > where I start it up, it connects to two of my servers (boris, kvm
> > based, the one that likes to not set memory properly, and snidely xen
> > based that we'll ignore for now)
> 
> Hmm, seems like virt-manager is using the correct values, at least for
> redefining the persistent VM config.
> 
> > After I kill the vm in that log you'll see I try to set the memory
> > again, and restart the vm, but this time it just didn't start. it said
> > it was running, but virt-manager didn't want to connect to the console
> > and the stats for it were stuck, all I could do was "force off" again.
> 
> Not sure what happened there, could be a weird side effect of the messed
> up memory values.
> 
> Can you retry the memory change on a running VM, then provide:
> 
> virsh dumpxml $vmname
> virsh dumpxml --inactive $vmname
> virsh dominfo $vmname

Sorry it took so long. Been busy with other things.

Attached is the data you requested.

virsh dumpxml $vmname -> test1.dump1
virsh dumpxml --inactive $vmname -> test1.dump1-inactive
virsh dominfo $vmname -> test1.dump1-dominfo

> What virsh command were you using for memory hotplug that worked
> successfully? Can you try that too starting from a working config, then
> provide the virsh output as above.

this is a command I just used to reduce that same vm to 256M after I started 
it back up after it OOMKilled itself with the last command:

virsh setmem test1 262144

And it worked just fine.

Attached are the new files, with dump2 appended instead.

> > Actually I'm confused as to why the xen one isn't reading disk usage
> > properly. Maybe it doesn't like that the xen setup is LVM backed rather
> > than file backed? But then the kvm instance is lvm backed too and that
> > works fine.
> 
> Not sure either. I'd file a xen bug with your distro.

I'm curious, can't libvirt get that info direct from lvm or the host?

> - Cole

And while using virt-manager the past week it has been crashing. A lot. In 
fact just when I went to boot the test1 vm again to run the virsh commands, 
poof, there it went. It seems to get worse when it tries to display and 
connect to vnc. But even without that it still crashes or hangs occasionally 
(like when trying to add new lvm volumes via the gui).

I also have a few little suggestions/concerns. When connecting to a xen 
backend with a secure connection it will popup a dialog that you have to 
enter the user/pass info in, but it won't let you just press enter once the 
info is filled in. Maybe it should also remember the info some how? If it can 
do it securely. Also, it hangs the entire gui when attempting to connect. 
Nothing overly important just little issues I've found while using it.

Thanks

-- 
Thomas Fjellstrom
tfjellstrom at shaw.ca
-------------- next part --------------
<domain type='kvm' id='12'>
  <name>test1</name>
  <uuid>96f4546f-4f75-deb2-5d1d-977d4ab79ce7</uuid>
  <memory>524288</memory>
  <currentMemory>28672</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.12'>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</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg0/test1-root'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg0/test1-swap'/>
      <target dev='vdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type=''/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:6c:ef:2a'/>
      <source bridge='vm_lan_bridge'/>
      <target dev='vnet2'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/3'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/3'>
      <source path='/dev/pts/3'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5902' autoport='yes' listen='0.0.0.0' keymap='en-us'/>
    <video>
      <model type='vmvga' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </memballoon>
  </devices>
</domain>

-------------- next part --------------
Id:             12
Name:           test1
UUID:           96f4546f-4f75-deb2-5d1d-977d4ab79ce7
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       112.1s
Max memory:     524288 kB
Used memory:    28672 kB
Persistent:     yes
Autostart:      disable

-------------- next part --------------
<domain type='kvm'>
  <name>test1</name>
  <uuid>96f4546f-4f75-deb2-5d1d-977d4ab79ce7</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.12'>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</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg0/test1-root'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg0/test1-swap'/>
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type=''/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>
    <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:6c:ef:2a'/>
      <source bridge='vm_lan_bridge'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='en-us'/>
    <video>
      <model type='vmvga' 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='0x03' function='0x0'/>
    </memballoon>
  </devices>
</domain>

-------------- next part --------------
<domain type='kvm' id='13'>
  <name>test1</name>
  <uuid>96f4546f-4f75-deb2-5d1d-977d4ab79ce7</uuid>
  <memory>524288</memory>
  <currentMemory>262144</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.12'>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</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg0/test1-root'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg0/test1-swap'/>
      <target dev='vdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type=''/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:6c:ef:2a'/>
      <source bridge='vm_lan_bridge'/>
      <target dev='vnet2'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/3'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/3'>
      <source path='/dev/pts/3'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5902' autoport='yes' listen='0.0.0.0' keymap='en-us'/>
    <video>
      <model type='vmvga' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </memballoon>
  </devices>
</domain>

-------------- next part --------------
Id:             13
Name:           test1
UUID:           96f4546f-4f75-deb2-5d1d-977d4ab79ce7
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       11.2s
Max memory:     524288 kB
Used memory:    262144 kB
Persistent:     yes
Autostart:      disable

-------------- next part --------------
<domain type='kvm'>
  <name>test1</name>
  <uuid>96f4546f-4f75-deb2-5d1d-977d4ab79ce7</uuid>
  <memory>524288</memory>
  <currentMemory>262144</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.12'>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</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg0/test1-root'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg0/test1-swap'/>
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type=''/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>
    <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:6c:ef:2a'/>
      <source bridge='vm_lan_bridge'/>
      <target dev='vnet2'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='en-us'/>
    <video>
      <model type='vmvga' 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='0x03' function='0x0'/>
    </memballoon>
  </devices>
</domain>



More information about the virt-tools-list mailing list