Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the test for transient disk #3133

Open
qiankehan opened this issue Oct 28, 2020 · 0 comments
Open

Enable the test for transient disk #3133

qiankehan opened this issue Oct 28, 2020 · 0 comments

Comments

@qiankehan
Copy link
Contributor

The transient disk will be enabled after the release of libvirt v6.9 (see the news ):
Here is a example to test the transient disk:

1. Start an VM with a transient disk:
# virsh dumpxml fedora31
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/tmp/test'/>
      <target dev='vdb' bus='virtio'/>
      <transient/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </disk>
...

# virsh start fedora31                                                 
Domain fedora31 started


2. Check the live xml
# virsh dumpxml fedora31|xmllint --xpath //disk -
<disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/tmp/test.TRANSIENT" index="3"/>
      <backingStore type="file" index="1">
        <format type="raw"/>
        <source file="/tmp/test"/>
        <backingStore/>
      </backingStore>
      <target dev="vdb" bus="virtio"/>
      <transient/>
      <alias name="virtio-disk1"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/>
    </disk>

3. Destory the VM and check if TRANSIENT file is there:
# virsh destroy fedora31                         
Domain fedora31 destroyed

# file /tmp/test.TRANSIENT
/tmp/test.TRANSIENT: cannot open `/tmp/test.TRANSIENT' (No such file or directory)

4. Start VM. And live detach the vm, then check if TRANSIENT file is there:
# virsh detach-disk fedora31 vdb
Disk detached successfully

# file /tmp/test.TRANSIENT      
/tmp/test.TRANSIENT: cannot open `/tmp/test.TRANSIENT' (No such file or directory)

Notifications:

  1. current checking for transient disk is not correct because it is not functionally enabled before v6.9
  2. According to the validating code of transient disk, it works only on the following conditions:
  • blockdev is used (v5.10 or later)
  • the disk source is a local file
  • the disk type is 'disk'
  • the disk is not readonly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant