From 46bc7fb46d5981dfa9d71087dadb52d7eba9c193 Mon Sep 17 00:00:00 2001 From: "Carlos J. Herrera" Date: Mon, 13 Dec 2021 08:10:28 -0500 Subject: [PATCH] B #5662: fix back compatibility (#1664) --- .../remotes/lib/vcenter_driver/virtual_machine.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb index 1d170e1b87..5622b85c1e 100644 --- a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb +++ b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb @@ -2067,7 +2067,7 @@ end end card_spec = { - :key => Time.now.utc.strftime('%Y%m%d%M%S%L').to_i, + :key => 0, :deviceInfo => { :label => 'net' + card_num.to_s, :summary => pg_name @@ -2077,6 +2077,9 @@ end :macAddress => mac, :unitNumber => unumber } + if @vi_client.vim.serviceContent.about.apiVersion.to_f >= 7.0 + card_spec[:key] = Time.now.utc.strftime('%m%d%M%S%L').to_i + end if (limit || rsrv) && (limit > 0) ra_spec = {} @@ -2213,7 +2216,7 @@ end end card_spec = { - :key => Time.now.utc.strftime('%Y%m%d%M%S%L').to_i, + :key => 0, :deviceInfo => { :label => 'net' + card_num.to_s, :summary => pg_name @@ -2221,6 +2224,9 @@ end :backing => backing, :addressType => 'generated' } + if @vi_client.vim.serviceContent.about.apiVersion.to_f >= 7.0 + card_spec[:key] = Time.now.utc.strftime('%m%d%M%S%L').to_i + end if (limit || rsrv) && (limit > 0) ra_spec = {}