Compare commits
7 Commits
better-xen
...
throw-when
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bf2399495 | ||
|
|
76fb2a159d | ||
|
|
f8a7249e32 | ||
|
|
4c2dd689e4 | ||
|
|
456e55d54a | ||
|
|
862e382c12 | ||
|
|
203a5c681e |
@@ -12,6 +12,7 @@
|
|||||||
- [Host] Display warning when host's time differs too much from XOA's time [#4113](https://github.com/vatesfr/xen-orchestra/issues/4113) (PR [#4173](https://github.com/vatesfr/xen-orchestra/pull/4173))
|
- [Host] Display warning when host's time differs too much from XOA's time [#4113](https://github.com/vatesfr/xen-orchestra/issues/4113) (PR [#4173](https://github.com/vatesfr/xen-orchestra/pull/4173))
|
||||||
- [Host/storages, SR/hosts] Display PBD details [#4264](https://github.com/vatesfr/xen-orchestra/issues/4161) (PR [#4268](https://github.com/vatesfr/xen-orchestra/pull/4284))
|
- [Host/storages, SR/hosts] Display PBD details [#4264](https://github.com/vatesfr/xen-orchestra/issues/4161) (PR [#4268](https://github.com/vatesfr/xen-orchestra/pull/4284))
|
||||||
- [VM/network] Display and set bandwidth rate-limit of a VIF [#4215](https://github.com/vatesfr/xen-orchestra/issues/4215) (PR [#4293](https://github.com/vatesfr/xen-orchestra/pull/4293))
|
- [VM/network] Display and set bandwidth rate-limit of a VIF [#4215](https://github.com/vatesfr/xen-orchestra/issues/4215) (PR [#4293](https://github.com/vatesfr/xen-orchestra/pull/4293))
|
||||||
|
- [Settings/servers] Display servers connection issues [#4300](https://github.com/vatesfr/xen-orchestra/issues/4300) (PR [#4310](https://github.com/vatesfr/xen-orchestra/pull/4310))
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
|
|
||||||
### Released packages
|
### Released packages
|
||||||
|
|
||||||
|
- xen-api v0.26.0
|
||||||
- xo-server-auth-saml v0.6.0
|
- xo-server-auth-saml v0.6.0
|
||||||
- xo-server-backup-reports v0.16.2
|
- xo-server-backup-reports v0.16.2
|
||||||
- xo-server v5.44.0
|
- xo-server v5.44.0
|
||||||
|
|||||||
@@ -99,6 +99,9 @@ export class Xapi extends EventEmitter {
|
|||||||
this._sessionId = undefined
|
this._sessionId = undefined
|
||||||
this._status = DISCONNECTED
|
this._status = DISCONNECTED
|
||||||
|
|
||||||
|
this._lastCatchedEventError = null
|
||||||
|
this._lastSuccessfulFetchTime = undefined
|
||||||
|
|
||||||
this._debounce = opts.debounce ?? 200
|
this._debounce = opts.debounce ?? 200
|
||||||
this._objects = new Collection()
|
this._objects = new Collection()
|
||||||
this._objectsByRef = { __proto__: null }
|
this._objectsByRef = { __proto__: null }
|
||||||
@@ -585,6 +588,14 @@ export class Xapi extends EventEmitter {
|
|||||||
throw new Error('no object with UUID: ' + uuid)
|
throw new Error('no object with UUID: ' + uuid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get lastCatchedEventError() {
|
||||||
|
return this._lastCatchedEventError
|
||||||
|
}
|
||||||
|
|
||||||
|
get lastSuccessfulFetchTime() {
|
||||||
|
return this._lastSuccessfulFetchTime
|
||||||
|
}
|
||||||
|
|
||||||
// manually run events watching if set to `false` in constructor
|
// manually run events watching if set to `false` in constructor
|
||||||
watchEvents() {
|
watchEvents() {
|
||||||
ignoreErrors.call(this._watchEvents())
|
ignoreErrors.call(this._watchEvents())
|
||||||
@@ -945,12 +956,14 @@ export class Xapi extends EventEmitter {
|
|||||||
],
|
],
|
||||||
EVENT_TIMEOUT * 1e3 * 1.1
|
EVENT_TIMEOUT * 1e3 * 1.1
|
||||||
)
|
)
|
||||||
|
this._lastSuccessfulFetchTime = Date.now()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error?.code === 'EVENTS_LOST') {
|
if (error?.code === 'EVENTS_LOST') {
|
||||||
// eslint-disable-next-line no-labels
|
// eslint-disable-next-line no-labels
|
||||||
continue mainLoop
|
continue mainLoop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._lastCatchedEventError = error
|
||||||
console.warn('_watchEvents', error)
|
console.warn('_watchEvents', error)
|
||||||
await pDelay(this._eventPollDelay)
|
await pDelay(this._eventPollDelay)
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -87,5 +87,8 @@ mountsDir = '/run/xo-server/mounts'
|
|||||||
# timeout in milliseconds (set to 0 to disable)
|
# timeout in milliseconds (set to 0 to disable)
|
||||||
timeout = 600e3
|
timeout = 600e3
|
||||||
|
|
||||||
|
# timeout before reporting server issue
|
||||||
|
noEventsTimeout = '5 minutes'
|
||||||
|
|
||||||
# see https:#github.com/vatesfr/xen-orchestra/issues/3419
|
# see https:#github.com/vatesfr/xen-orchestra/issues/3419
|
||||||
# useSudo = false
|
# useSudo = false
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { noSuchObject } from 'xo-common/api-errors'
|
|||||||
import { pDelay, ignoreErrors } from 'promise-toolbox'
|
import { pDelay, ignoreErrors } from 'promise-toolbox'
|
||||||
|
|
||||||
import * as XenStore from '../_XenStore'
|
import * as XenStore from '../_XenStore'
|
||||||
|
import parseDuration from '../_parseDuration'
|
||||||
import Xapi from '../xapi'
|
import Xapi from '../xapi'
|
||||||
import xapiObjectToXo from '../xapi-object-to-xo'
|
import xapiObjectToXo from '../xapi-object-to-xo'
|
||||||
import XapiStats from '../xapi-stats'
|
import XapiStats from '../xapi-stats'
|
||||||
@@ -41,7 +42,7 @@ const log = createLogger('xo:xo-mixins:xen-servers')
|
|||||||
// - _xapis[server.id] id defined
|
// - _xapis[server.id] id defined
|
||||||
// - _serverIdsByPool[xapi.pool.$id] is server.id
|
// - _serverIdsByPool[xapi.pool.$id] is server.id
|
||||||
export default class {
|
export default class {
|
||||||
constructor(xo, { guessVhdSizeOnImport, xapiOptions }) {
|
constructor(xo, { guessVhdSizeOnImport, noEventsTimeout, xapiOptions }) {
|
||||||
this._objectConflicts = { __proto__: null } // TODO: clean when a server is disconnected.
|
this._objectConflicts = { __proto__: null } // TODO: clean when a server is disconnected.
|
||||||
const serversDb = (this._servers = new Servers({
|
const serversDb = (this._servers = new Servers({
|
||||||
connection: xo._redis,
|
connection: xo._redis,
|
||||||
@@ -56,6 +57,7 @@ export default class {
|
|||||||
}
|
}
|
||||||
this._xapis = { __proto__: null }
|
this._xapis = { __proto__: null }
|
||||||
this._xo = xo
|
this._xo = xo
|
||||||
|
this._noEventsTimeout = parseDuration(noEventsTimeout)
|
||||||
|
|
||||||
xo.on('clean', () => serversDb.rebuildIndexes())
|
xo.on('clean', () => serversDb.rebuildIndexes())
|
||||||
xo.on('start', async () => {
|
xo.on('start', async () => {
|
||||||
@@ -473,6 +475,11 @@ export default class {
|
|||||||
const servers = await this._servers.get()
|
const servers = await this._servers.get()
|
||||||
const xapis = this._xapis
|
const xapis = this._xapis
|
||||||
forEach(servers, server => {
|
forEach(servers, server => {
|
||||||
|
const lastSuccessfulFetchTime = xapis[server.id]?.lastSuccessfulFetchTime
|
||||||
|
const currentTime = new Date().getTime()
|
||||||
|
if (currentTime > lastSuccessfulFetchTime + this._noEventsTimeout) {
|
||||||
|
server.error = xapis[server.id].lastCatchedEventError
|
||||||
|
}
|
||||||
server.status = this._getXenServerStatus(server.id)
|
server.status = this._getXenServerStatus(server.id)
|
||||||
if (server.status === 'connected') {
|
if (server.status === 'connected') {
|
||||||
server.poolId = xapis[server.id].pool.uuid
|
server.poolId = xapis[server.id].pool.uuid
|
||||||
|
|||||||
@@ -1676,6 +1676,9 @@ const messages = {
|
|||||||
serverSelfSignedCertError: 'Invalid self-signed certificate',
|
serverSelfSignedCertError: 'Invalid self-signed certificate',
|
||||||
serverSelfSignedCertQuestion:
|
serverSelfSignedCertQuestion:
|
||||||
'Do you want to accept self-signed certificate for this server even though it would decrease security?',
|
'Do you want to accept self-signed certificate for this server even though it would decrease security?',
|
||||||
|
serverEnabled: 'Enabled',
|
||||||
|
serverDisabled: 'Disabled',
|
||||||
|
serverDisable: 'Disable server',
|
||||||
|
|
||||||
// ----- Copy VM -----
|
// ----- Copy VM -----
|
||||||
copyVm: 'Copy VM',
|
copyVm: 'Copy VM',
|
||||||
|
|||||||
@@ -100,17 +100,17 @@ const COLUMNS = [
|
|||||||
itemRenderer: server => (
|
itemRenderer: server => (
|
||||||
<div>
|
<div>
|
||||||
<StateButton
|
<StateButton
|
||||||
disabledLabel={_('serverDisconnected')}
|
disabledLabel={_('serverDisabled')}
|
||||||
disabledHandler={connectServer}
|
disabledHandler={connectServer}
|
||||||
disabledTooltip={_('serverConnect')}
|
disabledTooltip={_('serverDisabled')}
|
||||||
enabledLabel={_('serverConnected')}
|
enabledLabel={_('serverEnabled')}
|
||||||
enabledHandler={disconnectServer}
|
enabledHandler={disconnectServer}
|
||||||
enabledTooltip={_('serverDisconnect')}
|
enabledTooltip={_('serverDisable')}
|
||||||
handlerParam={server}
|
handlerParam={server}
|
||||||
pending={server.status === 'connecting'}
|
pending={server.status === 'connecting'}
|
||||||
state={server.status === 'connected'}
|
state={server.status === 'connected'}
|
||||||
/>{' '}
|
/>{' '}
|
||||||
{server.error && (
|
{server.status === 'connected' && server.error && (
|
||||||
<Tooltip content={_('serverConnectionFailed')}>
|
<Tooltip content={_('serverConnectionFailed')}>
|
||||||
<a
|
<a
|
||||||
className='text-danger btn btn-link btn-sm'
|
className='text-danger btn btn-link btn-sm'
|
||||||
|
|||||||
Reference in New Issue
Block a user