Add disk is getting disk mode as independent #21848
Replies: 5 comments
-
@agrare Do you know? |
Beta Was this translation helpful? Give feedback.
-
Hey @posttoashok when provisioning a VM new disks are added to the clone config spec via this method: https://github.com/ManageIQ/manageiq-providers-vmware/blob/master/app/models/manageiq/providers/vmware/infra_manager/provision/configuration/disk.rb#L73-L106 The odd part is that while it is not user configurable, it is hard-coded to the "persistent" disk mode [here], not independent-persistent so I'm not sure how you're getting new disks as independent persistent. Are the independent-persistent disks possible coming from the template and not the new disks? I will also try to reproduce on my side. FYI here are the possible values for that diskMode attribute https://vdc-download.vmware.com/vmwb-repository/dcr-public/b50dcbbf-051d-4204-a3e7-e1b618c1e384/538cf2ec-b34f-4bae-a332-3820ef9e7773/vim.vm.device.VirtualDiskOption.DiskMode.html |
Beta Was this translation helpful? Give feedback.
-
@posttoashok I tried to reproduce this by provisioning a template with a single Dependent disk and part of the provision options add a new disk with options The resulting VM has two disks both show up as Dependent.
When the source template has an Independent - Persistent disk the new disk still is added as Dependent by default. |
Beta Was this translation helpful? Give feedback.
-
After i adding below given, Now I am getting add disk as persistent disk Automate/Explorer/Custom_Domain/ |
Beta Was this translation helpful? Give feedback.
-
That's great @posttoashok, just one thing to note the |
Beta Was this translation helpful? Give feedback.
-
Hi,
During VM proviison, I am trying to add a additional diks, but the disk is getting Disk mode as independent - Presistent.
Let me know how to make it as dependent by default?
I have tried as below in /var/www/miq/vmdb/app/models/vm_or_template/operations/configuration.rb
Deleted this line:-
def raw_add_disk(_disk_name, _disk_size_mb, _options = {})
raise NotImplementedError, _("must be implemented in a subclass")
end
Added this line:-
def raw_add_disk(disk_name, disk_size_mb, options = {})
raise _("VM has no EMS, unable to add disk") unless ext_management_system
options[:dependent]=true
run_command_via_parent(:vm_add_disk, :diskName => disk_name, :diskSize => disk_size_mb,
:thinProvisioned => options[:thin_provisioned], :dependent => options[:dependent], :persistent => options[:persistent])
end
but no luck
Beta Was this translation helpful? Give feedback.
All reactions