manageiq-smartstate 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0bcd345041b6da4e617fb7868b70329ddfb7356
4
- data.tar.gz: ce9e91d3de3fd48f62958cb2dbbd5a09b3c69e34
3
+ metadata.gz: 1d2b72b1484823e29f31ec97946c358ed1bb2c2a
4
+ data.tar.gz: 6ca99573c4dfab61a2c9474cf4a52e1e5d1e27e1
5
5
  SHA512:
6
- metadata.gz: c959e61448233d5726894b88a95913990b752f4dd5eea54c03bed11f1d515871177478715df62b0ccfe19b437bb722595f8911fa4aeff3ccf1a8a4c4e881b36b
7
- data.tar.gz: e6414d9c2d70ec3a3cb4f71db61fc2b6222c3ed02712ac3f9ce40a9f3db495470fd92589bc5b4c4f05eaa7747c6fbcc07f3c225ba527b1307e32354fc6876278
6
+ metadata.gz: 394987f249638435e077ca2483acd4fcf75461c10467213ced9ca3b4d3a21b8ee855349414d4d773509874ccf37c87f3ecef465143e0c883cdc6ea8d0f2ac5ca
7
+ data.tar.gz: c48daab9410be7dcc229f0451dd4e41a4733c626c818340634757576d29965f46aeaed27889d0b31bf0a9709c118d0281de17f1c4d52083a66070199eef4b55f
@@ -7,21 +7,24 @@ class MiqAzureVm < MiqVm
7
7
  def initialize(azure_handle, args)
8
8
  @azure_handle = azure_handle
9
9
  @uri = nil
10
- @snap_name = nil
10
+ @disk_name = nil
11
11
  @resource_group = args[:resource_group]
12
+ @managed_image = args[:managed_image]
12
13
 
13
14
  raise ArgumentError, "MiqAzureVm: missing required arg :name" unless (@name = args[:name])
14
15
 
15
16
  if args[:image_uri]
16
17
  @uri = args[:image_uri]
18
+ elsif args[:managed_image]
19
+ @disk_name = args[:managed_image]
17
20
  elsif args[:resource_group] && args[:name]
18
- vm_obj = vm_svc.get(@name, @resource_group.name)
21
+ vm_obj = vm_svc.get(@name, @resource_group)
19
22
  os_disk = vm_obj.properties.storage_profile.os_disk
20
23
  if vm_obj.managed_disk?
21
24
  #
22
25
  # Use the EVM SNAPSHOT Added by the Provider
23
26
  #
24
- @snap_name = os_disk.name + "__EVM__SSA__SNAPSHOT"
27
+ @disk_name = os_disk.name + "__EVM__SSA__SNAPSHOT"
25
28
  else
26
29
  #
27
30
  # Non-Managed Disk Snapshot handling
@@ -39,7 +42,7 @@ class MiqAzureVm < MiqVm
39
42
  def getCfg
40
43
  cfg_hash = {}
41
44
  cfg_hash['displayname'] = @name
42
- file_name = @uri ? @uri : @snap_name
45
+ file_name = @uri ? @uri : @disk_name
43
46
 
44
47
  $log.debug("MiqAzureVm#getCfg: disk = #{file_name}")
45
48
 
@@ -66,8 +69,10 @@ class MiqAzureVm < MiqVm
66
69
  begin
67
70
  if @uri
68
71
  d = MiqDiskCache.new(AzureBlobDisk.new(sa_svc, @uri, d_info), 100, 128)
72
+ elsif @managed_image
73
+ d = MiqDiskCache.new(AzureManagedDisk.new(disk_svc, @disk_name, d_info), 200, 512)
69
74
  else
70
- d = MiqDiskCache.new(AzureManagedDisk.new(snap_svc, @snap_name, d_info), 200, 512)
75
+ d = MiqDiskCache.new(AzureManagedDisk.new(snap_svc, @disk_name, d_info), 200, 512)
71
76
  end
72
77
  rescue => err
73
78
  $log.error("#{err}: Couldn't open disk file: #{df}")
@@ -102,7 +107,7 @@ class MiqAzureVm < MiqVm
102
107
  disk_format = @vmConfig.getHash["#{disk_tag}.format"]
103
108
  disk_info.format = disk_format unless disk_format.blank?
104
109
  disk_info.rawDisk = true
105
- disk_info.resource_group = @resource_group.name
110
+ disk_info.resource_group = @resource_group
106
111
  disk_info
107
112
  end
108
113
 
@@ -117,4 +122,8 @@ class MiqAzureVm < MiqVm
117
122
  def snap_svc
118
123
  @snap_svc ||= Azure::Armrest::Storage::SnapshotService.new(@azure_handle)
119
124
  end
125
+
126
+ def disk_svc
127
+ @disk_svc ||= Azure::Armrest::Storage::DiskService.new(@azure_handle)
128
+ end
120
129
  end
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Smartstate
3
- VERSION = "0.1.5".freeze
3
+ VERSION = "0.1.6".freeze
4
4
  end
5
5
  end
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.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-23 00:00:00.000000000 Z
11
+ date: 2017-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure-armrest