mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Fix issue when creating virtual machines with more than 7 disks
This commit is contained in:
parent
c097faecc9
commit
5d99225b59
1 changed files with 7 additions and 2 deletions
|
@ -122,18 +122,23 @@ module Fog
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_disk disk, index = 0, operation = :add, controller_key = 1000
|
def create_disk disk, index = 0, operation = :add, controller_key = 1000
|
||||||
|
if (index > 6) then
|
||||||
|
_index = index + 1
|
||||||
|
else
|
||||||
|
_index = index
|
||||||
|
end
|
||||||
payload = {
|
payload = {
|
||||||
:operation => operation,
|
:operation => operation,
|
||||||
:fileOperation => operation == :add ? :create : :destroy,
|
:fileOperation => operation == :add ? :create : :destroy,
|
||||||
:device => RbVmomi::VIM.VirtualDisk(
|
:device => RbVmomi::VIM.VirtualDisk(
|
||||||
:key => disk.key || index,
|
:key => disk.key || _index,
|
||||||
:backing => RbVmomi::VIM.VirtualDiskFlatVer2BackingInfo(
|
:backing => RbVmomi::VIM.VirtualDiskFlatVer2BackingInfo(
|
||||||
:fileName => "[#{disk.datastore}]",
|
:fileName => "[#{disk.datastore}]",
|
||||||
:diskMode => disk.mode.to_sym,
|
:diskMode => disk.mode.to_sym,
|
||||||
:thinProvisioned => disk.thin
|
:thinProvisioned => disk.thin
|
||||||
),
|
),
|
||||||
:controllerKey => controller_key,
|
:controllerKey => controller_key,
|
||||||
:unitNumber => index,
|
:unitNumber => _index,
|
||||||
:capacityInKB => disk.size
|
:capacityInKB => disk.size
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue