Skip to content

Commit

Permalink
Add the "discard zero page" action to the hcs array driver
Browse files Browse the repository at this point in the history
  • Loading branch information
cvaroqui committed Nov 12, 2020
1 parent 1620d7b commit 81cd05b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions opensvc/drivers/array/hcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@
OPT.resource_group,
],
},
"discard_zero_page": {
"msg": "Reclaim freeable space of a DP volume.",
"options": [
OPT.id,
OPT.naa,
OPT.name,
],
},
},
"List actions": {
"list_mappings": {
Expand Down Expand Up @@ -1165,6 +1173,10 @@ def list_host_link(self, **kwargs):
return self.get_host_link()


def discard_zero_page(self, id=None, name=None, naa=None, **kwargs):
data = self.get_ldev(oid=id, name=name, naa=naa)
return self.put("/ldevs/%s/actions/discard-zero-page/invoke" % data["ldevId"])

@staticmethod
def fmt_lun_path(port_id, hostgroup_id, lun_id):
return ",".join([str(port_id), str(hostgroup_id), str(lun_id)])
Expand Down

0 comments on commit 81cd05b

Please sign in to comment.