Added disk selection and exclusion of deactivated disks - #87
Conversation
kobihk
left a comment
There was a problem hiding this comment.
@GMasta2000 Thanks for creating this PR for the master branch
to fix issue #86
|
|
||
| # Get the Attachments Disk | ||
| disk_attachments = vms_service.vm_service(vm.id).disk_attachments_service().list() | ||
| disksBackup = [] |
There was a problem hiding this comment.
please use the python convention
https://peps.python.org/pep-0008/#function-and-variable-names
like:
| disksBackup = [] | |
| disks_backup = [] |
| # Get the Attachments Disk | ||
| disk_attachments = vms_service.vm_service(vm.id).disk_attachments_service().list() | ||
| disksBackup = [] | ||
| BootableOnly = config.get_bootable_only() |
There was a problem hiding this comment.
same here ^^
| BootableOnly = config.get_bootable_only() | |
| bootable_only = config.get_bootable_only() |
| # print disk_attachment.id | ||
| # break | ||
| # print disks_id[0].__dict__ |
There was a problem hiding this comment.
if this code is not necessary maybe you can remove it
| # print disk_attachment.id | |
| # break | |
| # print disks_id[0].__dict__ |
|
|
||
| for disk_attachment in disksBackup: | ||
| if disk_attachment.bootable == True: | ||
| logger.info("Finding bootable disk: %s", disk_attachment.id) |
There was a problem hiding this comment.
maybe it will be better to use the new python3 format like:
| logger.info("Finding bootable disk: %s", disk_attachment.id) | |
| logger.info(f"Finding bootable disk: {disk_attachment.id}") |
IMHO it looks better and more readable.
| if disk_attachment.bootable == True: | ||
| logger.info("Finding bootable disk: %s", disk_attachment.id) | ||
| else: | ||
| logger.info("Finding disk: %s", disk_attachment.id) |
There was a problem hiding this comment.
same ^^
| logger.info("Finding disk: %s", disk_attachment.id) | |
| logger.info(f"Finding disk: {disk_attachment.id}") |
| # Backup deactivated disks, set to False to skip deactivated disks backup (Recommend). | ||
| # This True - causes an error deleting a snapshot of the VM when the state is on. | ||
| with_disks_deactivated=False | ||
| # an array of exclude disks id,exampel ["6d811aa25-52a1-45c3-9f40-1c7c868182c9","6e78d7c2-5786-4dz2-a966-fd308c23f08e"] |
There was a problem hiding this comment.
typo
| # an array of exclude disks id,exampel ["6d811aa25-52a1-45c3-9f40-1c7c868182c9","6e78d7c2-5786-4dz2-a966-fd308c23f08e"] | |
| # an array of exclude disks id, example ["6d811aa25-52a1-45c3-9f40-1c7c868182c9","6e78d7c2-5786-4dz2-a966-fd308c23f08e"] |
|
@kobihk Thanks, I changed the variables. |
|
Hi @wefixit-AT |
|
Hi @wefixit-AT |
|
Hi @wefixit-AT ^^??? |
I have transferred the changes that I made in 4.3 for disk filtering and additionally added default values for these parameters in config.py.