Skip to content

Commit 81c26b4

Browse files
authored
Merge pull request #2755 from dougm/issue-2753
vcsim: set summary.guest.{hostName,ipAddress} in CustomizeVM
2 parents a2241de + 16e6bac commit 81c26b4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

govc/test/vm.bats

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,16 @@ load test_helper
11161116
run govc object.collect -s vm/DC0_H0_VM0 guest.ipAddress
11171117
assert_success 10.0.0.43
11181118

1119+
run govc object.collect -s vm/DC0_H0_VM0 summary.guest.ipAddress
1120+
assert_success 10.0.0.43
1121+
1122+
run govc object.collect -s vm/DC0_H0_VM0 summary.guest.hostName
1123+
assert_success windoze
1124+
1125+
run govc vm.info DC0_H0_VM0
1126+
assert_success
1127+
assert_matches 10.0.0.43
1128+
11191129
run govc object.collect -s vm/DC0_H0_VM0 guest.hostName
11201130
assert_success windoze
11211131

simulator/virtual_machine.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,9 +2029,11 @@ func (vm *VirtualMachine) customize(ctx *Context) {
20292029
}
20302030
if hostname != "" {
20312031
changes = append(changes, types.PropertyChange{Name: "guest.hostName", Val: hostname})
2032+
changes = append(changes, types.PropertyChange{Name: "summary.guest.hostName", Val: hostname})
20322033
}
20332034
if address != "" {
20342035
changes = append(changes, types.PropertyChange{Name: "guest.ipAddress", Val: address})
2036+
changes = append(changes, types.PropertyChange{Name: "summary.guest.ipAddress", Val: address})
20352037
}
20362038

20372039
vm.imc = nil

0 commit comments

Comments
 (0)