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

[libvirt] Error when creating VM with persistent memory

I am trying to create a VM with added persistent memory using virsh. It fails when persistent memory namespace size is larger than available system memory. Please see error below, prealloc=yes is set in the command line. For dax type namespace, as I understand, prealloc should not be needed. Is this support to add persistent memory implemented in virsh? If so, how to set prealloc=no? Anything else needed to add in xml for persistent memory? Thanks.


  1. dax namespace (400GB) which is larger than system memory.

# ndctl create-namespace -t pmem -m devdax --align=4k -s 400G {




  "size":"393.75 GiB (422.78 GB)",





    "size":"393.75 GiB (422.78 GB)",





        "size":"393.75 GiB (422.78 GB)"






2. Relevant parts of xml

<domain type='kvm'>



  <maxMemory slots='16' unit='KiB'>459800576</maxMemory>

  <memory unit='KiB'>65536000</memory>

  <currentMemory unit='KiB'>65536000</currentMemory>

  <vcpu placement='static'>4</vcpu>




<cpu mode='custom' match='exact' check='partial'>

    <feature policy='require' name='hypervisor'/>


      <cell id='0' cpus='0-3' memory='65536000' unit='KiB'/>





  <memory model='nvdimm'>





        <size unit='GiB'>376</size>



          <size unit='KiB'>128</size>



      <address type='dimm' slot='0'/>




3. Error:

# virsh start test

error: Failed to start domain test

error: internal error: qemu unexpectedly closed the monitor: ftruncate: Invalid argument 2019-08-22T04:16:08.744402Z qemu-system-x86_64: -object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/dev/dax1.0,size=403726925824: unable to map backing store for guest RAM: Cannot allocate memory


Virsh version 4.7.0, qemu version 3.0.0

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