(POOLER-166) Vmpooler should check DNS to ensure a record does not exist before VM creation

initial draft
This commit is contained in:
Samuel Beaulieu 2020-05-27 17:59:06 -05:00
parent 46af69f67b
commit 616db575f8
5 changed files with 65 additions and 1 deletions

View file

@ -189,7 +189,10 @@ MockVirtualMachine = Struct.new(
:name,
# From RbVmomi::VIM::ManagedEntity
# https://github.com/vmware/rbvmomi/blob/master/lib/rbvmomi/vim/ManagedEntity.rb
:path
:path,
# https://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.GuestInfo.html
# From GuestInfo
:guest
)
MockVirtualMachineSnapshot = Struct.new(
@ -288,6 +291,18 @@ MockVirtualHardware = Struct.new(
:device
)
MockGuestInfo = Struct.new(
# https://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.GuestInfo.html
# From GuestInfo
:hostName, :ipAddress, :net
)
MockGuestNicInfo = Struct.new(
# https://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.GuestInfo.NicInfo.html
# From GuestNicInfo
:connected, :ipAddress, :macAddress
)
MockVirtualMachineConfigInfo = Struct.new(
# https://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.ConfigInfo.html
# From VirtualMachineConfigInfo
@ -691,6 +706,8 @@ def mock_RbVmomi_VIM_VirtualMachine(options = {})
mock = MockVirtualMachine.new()
mock.config = MockVirtualMachineConfigInfo.new()
mock.config.hardware = MockVirtualHardware.new([])
mock.guest = MockGuestInfo.new()
mock.guest.net = MockGuestNicInfo.new([])
mock.summary = MockVirtualMachineSummary.new()
mock.summary.runtime = MockVirtualMachineRuntimeInfo.new()
mock.summary.guest = MockVirtualMachineGuestSummary.new()