manageiq-smartstate 0.5.10 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/MiqVm/MiqRhevmVm.rb +1 -1
- data/lib/MiqVm/MiqVm.rb +0 -140
- data/lib/OpenStackExtract/MiqOpenStackVm/MiqOpenStackImage.rb +0 -1
- data/lib/OpenStackExtract/MiqOpenStackVm/MiqOpenStackInstance.rb +0 -1
- data/lib/VolumeManager/MiqLdm.rb +1 -1
- data/lib/db/MiqSqlite/MiqSqlite3Cell.rb +2 -3
- data/lib/fs/ext3/superblock.rb +1 -1
- data/lib/fs/ext4/superblock.rb +2 -2
- data/lib/fs/ntfs/attrib_object_id.rb +1 -1
- data/lib/fs/xfs/allocation_group.rb +1 -1
- data/lib/fs/xfs/bmap_btree_block.rb +1 -1
- data/lib/fs/xfs/superblock.rb +1 -1
- data/lib/manageiq/smartstate/version.rb +1 -1
- data/lib/metadata/MIQExtract/MIQExtract.rb +0 -1
- data/lib/metadata/VmConfig/VmConfig.rb +4 -4
- data/lib/metadata/util/md5deep.rb +4 -2
- data/lib/metadata/util/win32/Win32EventLog.rb +2 -2
- data/lib/metadata/util/win32/peheader.rb +4 -6
- data/manageiq-smartstate.gemspec +3 -2
- metadata +25 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dc46ede682ac6c4b95558f1856c26b8bedda0cc01a8d4302d72530cf9cf01cbc
|
4
|
+
data.tar.gz: ded7f8e35edf8a05db918015aaec80b934256232df374a428eb5e22a7911f1ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecb7a9753e7863f0a1c2e755e238d45ba88036dd8660a5a71507157347e034e324ff5e5352a056fb7f840aeeb5f761a1224d9172aa7986b71aee9c967ff68211
|
7
|
+
data.tar.gz: 24ffa299fb984257c85b907a7acd57fd4c364512af79dda73b3c73b6ed610a1f2c61de34750433090d81092659754f6820d16416ea470cdb4ffac8ee86f8352b
|
data/lib/MiqVm/MiqRhevmVm.rb
CHANGED
@@ -42,7 +42,7 @@ class MiqRhevmVm < MiqVm
|
|
42
42
|
disks = @rhevm.collect_vm_disks(@rhevmVm)
|
43
43
|
disks.each_with_index do |disk, idx|
|
44
44
|
$log.debug "MiqRhevmVm#getCfg: disk = #{disk.inspect}"
|
45
|
-
storage_domain = disk.storage_domains
|
45
|
+
storage_domain = disk.storage_domains.first
|
46
46
|
if storage_domain.nil?
|
47
47
|
$log.info("Disk <#{disk.name}> is skipped due to unassigned storage domain")
|
48
48
|
next
|
data/lib/MiqVm/MiqVm.rb
CHANGED
@@ -205,143 +205,3 @@ class MiqVm
|
|
205
205
|
(xml)
|
206
206
|
end
|
207
207
|
end # class MiqVm
|
208
|
-
|
209
|
-
if __FILE__ == $0
|
210
|
-
require 'metadata/util/win32/boot_info_win'
|
211
|
-
|
212
|
-
# vmDir = File.join(ENV.fetch("HOME", '.'), 'VMs')
|
213
|
-
vmDir = "/volumes/WDpassport/Virtual Machines"
|
214
|
-
puts "vmDir = #{vmDir}"
|
215
|
-
|
216
|
-
targetLv = "rpolv2"
|
217
|
-
rootLv = "LogVol00"
|
218
|
-
|
219
|
-
require 'logger'
|
220
|
-
$log = Logger.new(STDERR)
|
221
|
-
$log.level = Logger::DEBUG
|
222
|
-
|
223
|
-
#
|
224
|
-
# *** Test start
|
225
|
-
#
|
226
|
-
|
227
|
-
# vmCfg = File.join(vmDir, "cacheguard/cacheguard.vmx")
|
228
|
-
# vmCfg = File.join(vmDir, "Red Hat Linux.vmwarevm/Red Hat Linux.vmx")
|
229
|
-
# vmCfg = File.join(vmDir, "MIQ Server Appliance - Ubuntu MD - small/MIQ Server Appliance - Ubuntu.vmx")
|
230
|
-
# vmCfg = File.join(vmDir, "winxpDev.vmwarevm/winxpDev.vmx")
|
231
|
-
vmCfg = File.join(vmDir, "Win2K_persistent/Windows 2000 Professional.vmx")
|
232
|
-
# vmCfg = File.join(vmDir, "Win2K_non_persistent/Windows 2000 Professional.vmx")
|
233
|
-
puts "VM config file: #{vmCfg}"
|
234
|
-
|
235
|
-
ost = OpenStruct.new
|
236
|
-
ost.openParent = true
|
237
|
-
|
238
|
-
vm = MiqVm.new(vmCfg, ost)
|
239
|
-
|
240
|
-
puts "\n*** Disk Files:"
|
241
|
-
vm.vmConfig.getDiskFileHash.each do |k, v|
|
242
|
-
puts "\t#{k}\t#{v}"
|
243
|
-
end
|
244
|
-
|
245
|
-
puts "\n*** configHash:"
|
246
|
-
vm.vmConfig.getHash.each do |k, v|
|
247
|
-
puts "\t#{k} => #{v}"
|
248
|
-
end
|
249
|
-
|
250
|
-
tlv = nil
|
251
|
-
rlv = nil
|
252
|
-
puts "\n*** Visible Volumes:"
|
253
|
-
vm.volumeManager.visibleVolumes.each do |vv|
|
254
|
-
puts "\tDisk type: #{vv.diskType}"
|
255
|
-
puts "\tDisk sig: #{vv.diskSig}"
|
256
|
-
puts "\tStart LBA: #{vv.lbaStart}"
|
257
|
-
if vv.respond_to?(:logicalVolume)
|
258
|
-
puts "\t\tLV name: #{vv.logicalVolume.lvName}"
|
259
|
-
puts "\t\tLV UUID: #{vv.logicalVolume.lvId}"
|
260
|
-
tlv = vv if vv.logicalVolume.lvName == targetLv
|
261
|
-
rlv = vv if vv.logicalVolume.lvName == rootLv
|
262
|
-
end
|
263
|
-
end
|
264
|
-
|
265
|
-
# raise "#{targetLv} not found" if !tlv
|
266
|
-
#
|
267
|
-
# tlv.seek(0, IO::SEEK_SET)
|
268
|
-
# rs = tlv.read(2040)
|
269
|
-
# puts "\n***** START *****"
|
270
|
-
# puts rs
|
271
|
-
# puts "****** END ******"
|
272
|
-
#
|
273
|
-
# tlv.seek(2048*512*5119, IO::SEEK_SET)
|
274
|
-
# rs = tlv.read(2040)
|
275
|
-
# puts "\n***** START *****"
|
276
|
-
# puts rs
|
277
|
-
# puts "****** END ******"
|
278
|
-
#
|
279
|
-
# raise "#{rootLv} not found" if !rlv
|
280
|
-
#
|
281
|
-
# puts "\n*** Mounting #{rootLv}"
|
282
|
-
# rfs = MiqFS.getFS(rlv)
|
283
|
-
# puts "\tFS Type: #{rfs.fsType}"
|
284
|
-
# puts "\t*** Root-level files and directories:"
|
285
|
-
# rfs.dirForeach("/") { |de| puts "\t\t#{de}" }
|
286
|
-
|
287
|
-
puts "\n***** Detected Guest OSs:"
|
288
|
-
raise "No OSs detected" if vm.rootTrees.length == 0
|
289
|
-
vm.rootTrees.each do |rt|
|
290
|
-
puts "\t#{rt.guestOS}"
|
291
|
-
if rt.guestOS == "Linux"
|
292
|
-
puts "\n\t\t*** /etc/fstab contents:"
|
293
|
-
rt.fileOpen("/etc/fstab", &:read).each_line do |fstl|
|
294
|
-
next if fstl =~ /^#.*$/
|
295
|
-
puts "\t\t\t#{fstl}"
|
296
|
-
end
|
297
|
-
end
|
298
|
-
end
|
299
|
-
|
300
|
-
vm.rootTrees.each do |rt|
|
301
|
-
if rt.guestOS == "Linux"
|
302
|
-
# tdirArr = [ "/", "/boot", "/var/www/miq", "/var/www/miq/vmdb/log", "/var/lib/mysql" ]
|
303
|
-
tdirArr = ["/", "/boot", "/etc/init.d", "/etc/rc.d/init.d", "/etc/rc.d/rc0.d"]
|
304
|
-
|
305
|
-
tdirArr.each do |tdir|
|
306
|
-
begin
|
307
|
-
puts "\n*** Listing #{tdir} directory (1):"
|
308
|
-
rt.dirForeach(tdir) { |de| puts "\t\t#{de}" }
|
309
|
-
puts "*** end"
|
310
|
-
|
311
|
-
puts "\n*** Listing #{tdir} directory (2):"
|
312
|
-
rt.chdir(tdir)
|
313
|
-
rt.dirForeach { |de| puts "\t\t#{de}" }
|
314
|
-
puts "*** end"
|
315
|
-
rescue => err
|
316
|
-
puts "*** #{err}"
|
317
|
-
end
|
318
|
-
end
|
319
|
-
|
320
|
-
# lf = rt.fileOpen("/etc/rc0.d/S01halt")
|
321
|
-
# puts "\n*** Contents of /etc/rc0.d/S01halt:"
|
322
|
-
# puts lf.read
|
323
|
-
# puts "*** END"
|
324
|
-
# lf.close
|
325
|
-
#
|
326
|
-
# lfn = "/etc/rc0.d/S01halt"
|
327
|
-
# puts "Is #{lfn} a symbolic link? #{rt.fileSymLink?(lfn)}"
|
328
|
-
# puts "#{lfn} => #{rt.getLinkPath(lfn)}"
|
329
|
-
else # Windows
|
330
|
-
tdirArr = ["c:/", "e:/", "e:/testE2", "f:/"]
|
331
|
-
|
332
|
-
tdirArr.each do |tdir|
|
333
|
-
puts "\n*** Listing #{tdir} directory (1):"
|
334
|
-
rt.dirForeach(tdir) { |de| puts "\t\t#{de}" }
|
335
|
-
puts "*** end"
|
336
|
-
|
337
|
-
puts "\n*** Listing #{tdir} directory (2):"
|
338
|
-
rt.chdir(tdir)
|
339
|
-
rt.dirForeach { |de| puts "\t\t#{de}" }
|
340
|
-
puts "*** end"
|
341
|
-
end
|
342
|
-
end
|
343
|
-
end
|
344
|
-
|
345
|
-
vm.unmount
|
346
|
-
puts "...done"
|
347
|
-
end
|
data/lib/VolumeManager/MiqLdm.rb
CHANGED
@@ -5,7 +5,6 @@ require 'enumerator'
|
|
5
5
|
|
6
6
|
require 'binary_struct'
|
7
7
|
require_relative 'MiqSqlite3Util'
|
8
|
-
require_relative 'MiqSqlite3Page'
|
9
8
|
|
10
9
|
module MiqSqlite3DB
|
11
10
|
class MiqSqlite3Cell
|
@@ -150,8 +149,8 @@ module MiqSqlite3DB
|
|
150
149
|
when 2 then return 2, 'integer'
|
151
150
|
when 3 then return 3, 'integer'
|
152
151
|
when 4 then return 4, 'integer'
|
153
|
-
when
|
154
|
-
when
|
152
|
+
when 5 then return 6, 'integer'
|
153
|
+
when 6 then return 8, 'integer'
|
155
154
|
when 7 then return 8, 'float'
|
156
155
|
when 8 then return 0, 'false'
|
157
156
|
when 9 then return 0, 'true'
|
data/lib/fs/ext3/superblock.rb
CHANGED
data/lib/fs/ext4/superblock.rb
CHANGED
@@ -4,7 +4,7 @@ require 'fs/ext4/group_descriptor_table'
|
|
4
4
|
require 'fs/ext4/inode'
|
5
5
|
|
6
6
|
require 'binary_struct'
|
7
|
-
require '
|
7
|
+
require 'uuidtools'
|
8
8
|
require 'stringio'
|
9
9
|
require 'memory_buffer'
|
10
10
|
|
@@ -225,7 +225,7 @@ module Ext4
|
|
225
225
|
end
|
226
226
|
|
227
227
|
def groupDescriptorSize
|
228
|
-
@groupDescriptorSize ||= is_enabled_64_bit? ? @sb['group_desc_size'] : GDE_SIZE
|
228
|
+
@groupDescriptorSize ||= is_enabled_64_bit? ? @sb['group_desc_size'] : GDE_SIZE
|
229
229
|
end
|
230
230
|
|
231
231
|
def freeBytes
|
data/lib/fs/xfs/superblock.rb
CHANGED
@@ -364,7 +364,7 @@ class VmConfig
|
|
364
364
|
|
365
365
|
def resolve_ds_path(filename)
|
366
366
|
# TODO: Determine if we need to do any work here.
|
367
|
-
ds,
|
367
|
+
ds, _dir, _name = split_filename(filename)
|
368
368
|
return filename unless ds.nil?
|
369
369
|
|
370
370
|
@ds_replace ||= {}
|
@@ -373,7 +373,7 @@ class VmConfig
|
|
373
373
|
end
|
374
374
|
|
375
375
|
ds_filename = resolve_ds_path_with_vim(filename)
|
376
|
-
ds, dir,
|
376
|
+
ds, dir, _name = split_filename(ds_filename)
|
377
377
|
unless ds.nil?
|
378
378
|
idx = filename.index(dir)
|
379
379
|
replaced_str = filename[0, idx]
|
@@ -498,7 +498,7 @@ class VmConfig
|
|
498
498
|
end
|
499
499
|
|
500
500
|
def rhevm_disk_file_entry(disk)
|
501
|
-
storage_id = disk.storage_domains
|
501
|
+
storage_id = disk.storage_domains.first&.id
|
502
502
|
disk_id = disk.image_id || disk.id
|
503
503
|
full_path = storage_id && File.join('/dev', storage_id, disk_id)
|
504
504
|
{:path => full_path, :name => disk_id, :size => disk.actual_size.to_i}
|
@@ -550,7 +550,7 @@ class VmConfig
|
|
550
550
|
elsif miqvm.rhevmVm
|
551
551
|
disks = miqvm.rhevm.collect_vm_disks(miqvm.rhevmVm)
|
552
552
|
disks.each do |disk|
|
553
|
-
storage_id = disk.storage_domains
|
553
|
+
storage_id = disk.storage_domains.first&.id
|
554
554
|
disk_id = disk.image_id || disk.id
|
555
555
|
full_path = storage_id && File.join('/dev', storage_id, disk_id)
|
556
556
|
d = {:path => full_path, :name => disk.name.to_s, :size => disk.actual_size.to_i}
|
@@ -13,6 +13,8 @@ class MD5deep
|
|
13
13
|
def initialize(fs = nil, options = {})
|
14
14
|
@fullFileCount = 0
|
15
15
|
@fullDirCount = 0
|
16
|
+
@drive_letter = nil
|
17
|
+
|
16
18
|
# Create XML document
|
17
19
|
@xml = XmlHash.createDoc(:filesystem)
|
18
20
|
@fs = fs.kind_of?(MiqFS) ? fs : nil
|
@@ -179,9 +181,9 @@ class MD5deep
|
|
179
181
|
|
180
182
|
def fileOpen(currFile)
|
181
183
|
if @fs
|
182
|
-
|
184
|
+
@fs.fileOpen(currFile)
|
183
185
|
else
|
184
|
-
|
186
|
+
File.open(currFile)
|
185
187
|
end
|
186
188
|
end
|
187
189
|
|
@@ -684,8 +684,8 @@ class Win32EventLog
|
|
684
684
|
reg.each_key do |subKey, _wtime|
|
685
685
|
subpath = "#{src}\\#{subKey}"
|
686
686
|
subKey.downcase!
|
687
|
-
Win32::Registry::HKEY_LOCAL_MACHINE.open(subpath) do |
|
688
|
-
|
687
|
+
Win32::Registry::HKEY_LOCAL_MACHINE.open(subpath) do |subreg|
|
688
|
+
subreg.each_value do |name, _type, data|
|
689
689
|
case name
|
690
690
|
when 'EventMessageFile', 'ParameterMessageFile', 'CategoryMessageFile' then
|
691
691
|
fn = data.to_s
|
@@ -15,8 +15,6 @@ class PEheader
|
|
15
15
|
IMAGE_NT_SIGNATURE = "PE\0\0"
|
16
16
|
IMAGE_DOS_SIGNATURE = "MZ"
|
17
17
|
|
18
|
-
attr_reader :imports, :icons, :messagetables, :versioninfo
|
19
|
-
|
20
18
|
def initialize(path)
|
21
19
|
@fname = path
|
22
20
|
@dataDirs = []
|
@@ -91,19 +89,19 @@ class PEheader
|
|
91
89
|
end
|
92
90
|
|
93
91
|
def imports
|
94
|
-
@
|
92
|
+
@imports ||= getImports
|
95
93
|
end
|
96
94
|
|
97
95
|
def icons
|
98
|
-
@
|
96
|
+
@icons ||= getIcons(@fBuf)
|
99
97
|
end
|
100
98
|
|
101
99
|
def messagetables
|
102
|
-
@
|
100
|
+
@messagetables ||= getMessagetables
|
103
101
|
end
|
104
102
|
|
105
103
|
def versioninfo
|
106
|
-
@
|
104
|
+
@versioninfo ||= getVersioninfo
|
107
105
|
end
|
108
106
|
|
109
107
|
# //////////////////////////////////////////////////////////////////////////
|
data/manageiq-smartstate.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_dependency "azure-armrest", "~> 0.9
|
23
|
+
spec.add_dependency "azure-armrest", "~> 0.9"
|
24
24
|
spec.add_dependency "binary_struct", "~> 2.1"
|
25
25
|
spec.add_dependency "iniparse"
|
26
26
|
spec.add_dependency "linux_block_device", "~>0.2.1"
|
@@ -28,7 +28,8 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency "memory_buffer", ">=0.1.0"
|
29
29
|
spec.add_dependency "rufus-lru", "~>1.0.3"
|
30
30
|
spec.add_dependency "sys-uname", "~>1.2.1"
|
31
|
-
spec.add_dependency "
|
31
|
+
spec.add_dependency "uuidtools", "~>2.1"
|
32
|
+
spec.add_dependency "vmware_web_service", "~>2.0"
|
32
33
|
|
33
34
|
spec.add_development_dependency "bundler"
|
34
35
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: manageiq-smartstate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ManageIQ Developers
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: azure-armrest
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.9
|
19
|
+
version: '0.9'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.9
|
26
|
+
version: '0.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: binary_struct
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,20 +122,34 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 1.2.1
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: uuidtools
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '2.1'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '2.1'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: vmware_web_service
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
143
|
- - "~>"
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
145
|
+
version: '2.0'
|
132
146
|
type: :runtime
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
152
|
+
version: '2.0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: bundler
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -263,7 +277,7 @@ dependencies:
|
|
263
277
|
- !ruby/object:Gem::Version
|
264
278
|
version: 1.0.0
|
265
279
|
description: ManageIQ SmartState Analysis
|
266
|
-
email:
|
280
|
+
email:
|
267
281
|
executables: []
|
268
282
|
extensions: []
|
269
283
|
extra_rdoc_files: []
|
@@ -546,7 +560,7 @@ homepage: https://github.com/ManageIQ/manageiq-smartstate
|
|
546
560
|
licenses:
|
547
561
|
- Apache-2.0
|
548
562
|
metadata: {}
|
549
|
-
post_install_message:
|
563
|
+
post_install_message:
|
550
564
|
rdoc_options: []
|
551
565
|
require_paths:
|
552
566
|
- lib
|
@@ -561,9 +575,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
561
575
|
- !ruby/object:Gem::Version
|
562
576
|
version: '0'
|
563
577
|
requirements: []
|
564
|
-
|
565
|
-
|
566
|
-
signing_key:
|
578
|
+
rubygems_version: 3.1.3
|
579
|
+
signing_key:
|
567
580
|
specification_version: 4
|
568
581
|
summary: ManageIQ SmartState Analysis
|
569
582
|
test_files: []
|