ossobv / proxmove

Migrate virtual machines between different Proxmox VE clusters with minimal downtime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

discard=on breaks for EFI disks

wdoekes opened this issue · comments

See #31 (comment)

[The] volume type would need to be available in the translator so it can skip setting discard=on if it sees type efidisk.

proxmove/proxmove

Lines 1860 to 1876 in 18fcd8d

class AddDiscardOnTranslator(object):
def volume_properties(self, new_volume):
"""
Add "discard=on" flag to properties if possible
"""
props = super().volume_properties(new_volume)
if new_volume.storage and new_volume.storage.has_discard_support:
values = props.split(',')
name, rest = values[0], values[1:]
rest = [
i for i in rest if i not in ('discard=on', 'discard=off')]
rest.append('discard=on')
rest.sort()
props = ','.join([name] + rest)
return props

This PR addesses things: #46