Vinzenz Feenstra has uploaded a new change for review.
Change subject: vdsm: Make guest agent FQDN information available
......................................................................
vdsm: Make guest agent FQDN information available
Change-Id: Ib6d92bbfc7c4d3004f12376bc44dafae1e339cdd
Bug-Url:
https://bugzilla.redhat.com/901415
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/guestIF.py
M vdsm/vm.py
M vdsm_api/vdsmapi-schema.json
3 files changed, 15 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/72/16572/1
diff --git a/vdsm/guestIF.py b/vdsm/guestIF.py
index 07f9c20..ccf7b61 100644
--- a/vdsm/guestIF.py
+++ b/vdsm/guestIF.py
@@ -85,6 +85,7 @@
'username': user,
'memUsage': 0,
'guestIPs': ips,
+ 'guestFQDN': '',
'session': 'Unknown',
'appsList': [],
'disksUsage': [],
@@ -198,6 +199,8 @@
self.guestInfo['appsList'] = []
elif message == 'session-startup':
self.log.debug("Guest system is started or restarted.")
+ elif message == 'fqdn':
+ self.guestInfo['guestFQDN'] = args['fqdn']
elif message == 'session-shutdown':
self.log.debug("Guest system shuts down.")
elif message == 'disks-usage':
@@ -240,7 +243,8 @@
'session': 'Unknown',
'memUsage': 0,
'appsList': self.guestInfo['appsList'],
- 'guestIPs': self.guestInfo['guestIPs']}
+ 'guestIPs': self.guestInfo['guestIPs'],
+ 'guestFQDN': self.guestInfo['guestFQDN']}
def onReboot(self):
self.guestStatus = 'RebootInProgress'
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 281c584..f1e9cc1 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -196,6 +196,8 @@
self._machineParams['username'] = vmStats['username']
if 'guestIPs' in vmStats:
self._machineParams['guestIPs'] = vmStats['guestIPs']
+ if 'guestFQDN' in vmStats:
+ self._machineParams['guestFQDN'] = vmStats['guestFQDN']
for k in ('_migrationParams', 'pid'):
if k in self._machineParams:
del self._machineParams[k]
@@ -2095,9 +2097,11 @@
if self.lastStatus != 'Down' and self._vmStats and self.guestAgent:
toSave['username'] = self.guestAgent.guestInfo['username']
toSave['guestIPs'] = self.guestAgent.guestInfo['guestIPs']
+ toSave['guestFQDN'] = self.guestAgent.guestInfo['guestFQDN']
else:
toSave['username'] = ""
toSave['guestIPs'] = ""
+ toSave['guestFQDN'] = ""
if 'sysprepInf' in toSave:
del toSave['sysprepInf']
if 'floppy' in toSave:
@@ -3274,6 +3278,8 @@
if 'guestIPs' in self.conf:
del self.conf['guestIPs']
+ if 'guestFQDN' in self.conf:
+ del self.conf['guestFQDN']
if 'username' in self.conf:
del self.conf['username']
self.saveState()
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 6e2fe64..ddd0de8 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -5212,6 +5212,9 @@
#
# @watchdogEvent: #optional Information about the most recent watchdog event
#
+# @guestFQDN: Fully qualified domain name of the guest OS. (Reported
+# by the guest agent)
+#
# Since: 4.10.0
##
{'type': 'RunningVmStats',
@@ -5230,7 +5233,7 @@
'memoryStats': 'GuestMemoryStats', 'balloonInfo':
'BalloonInfo',
'disksUsage': ['GuestMountInfo'],
'netIfaces': ['GuestNetworkDeviceInfo'],
- 'watchdogEvent': '*WatchdogEvent'}}
+ 'watchdogEvent': '*WatchdogEvent', 'guestFQDN':
'str'}}
##
# @VmStats:
--
To view, visit
http://gerrit.ovirt.org/16572
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6d92bbfc7c4d3004f12376bc44dafae1e339cdd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>