Module: VolMgrPlatformSupportLinux
- Defined in:
- lib/VolumeManager/VolMgrPlatformSupportLinux.rb
Instance Method Summary collapse
Instance Method Details
#init ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/VolumeManager/VolMgrPlatformSupportLinux.rb', line 5 def init $log.debug "VolMgrPlatformSupportLinux.init: #{@cfgFile}" @ems = nil @snMor = nil @vi = nil @vimVm = nil unless @ost.force $log.info "VolMgrPlatformSupportLinux.init: force flag = false" return end if @ost.miqVimVm $log.debug "VolMgrPlatformSupportLinux.init: Have miqVimVm" @vimVm = @ost.miqVimVm return end $log.debug "VolMgrPlatformSupportLinux.init: miqVimVm not set - should be a non VMware VM" end |
#postMount ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/VolumeManager/VolMgrPlatformSupportLinux.rb', line 47 def postMount log_prefix = "VolMgrPlatformSupportLinux.postMount" $log.debug "#{log_prefix} Enter: force = #{@ost.force}, @vimVm.nil? = #{@vimVm.nil?}" return unless @ost.force return unless @vimVm if @ost.force if !@snMor $log.warn "#{log_prefix}: VM not snapped: #{@cfgFile}" else $log.debug "#{log_prefix}: removing snapshot snMor = \"#{@snMor}\"" begin @vimVm.removeSnapshot(@snMor, "false", true, @ost.snapshot_remove_free_space) $log.info "#{log_prefix}: VM snapshot [#{@snMor}] removed" rescue => err $log.warn "#{log_prefix}: failed to remove snapshot for VM: #{@cfgFile}" $log.warn "#{log_prefix}: #{err}" end end end # # If we opened the vimVm (it wasn't passed into us) # then release it. # @vimVm.release unless @ost.miqVimVm @vimVm = nil @vi.disconnect if @vi @vi = nil @snMor = nil end |
#preMount ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/VolumeManager/VolMgrPlatformSupportLinux.rb', line 26 def preMount $log.debug "VolMgrPlatformSupportLinux.preMount Enter: force = #{@ost.force}" return unless @ost.force if @snMor $log.error "VolMgrPlatformSupportLinux.preMount - #{@cfgFile} is already mounted" return end unless @vimVm $log.warn "VolMgrPlatformSupportLinux.preMount: cannot snapshot VM not registered to this host: #{@cfgFile}" return end desc = @ost.snapshotDescription ? @ost.snapshotDescription : "EVM Snapshot" st = Time.now @snMor = @vimVm.createEvmSnapshot(desc, "false", true, @ost.snapshot_create_free_space) $log.info "VolMgrPlatformSupportLinux.preMount: VM snapshot [#{@snMor}] created in [#{Time.now - st}] seconds" $log.debug "VolMgrPlatformSupportLinux.preMount: snMor = \"#{@snMor}\"" end |