chore: re-format with Prettier
Related to c8aa058ede
Mainly due to https://prettier.io/blog/2019/06/06/1.18.0.html#stop-breaking-simple-template-literals-5979-by-jwbay
This commit is contained in:
@@ -364,9 +364,7 @@ export default class Vhd {
|
|||||||
const offset = blockAddr + this.sectorsOfBitmap + beginSectorId
|
const offset = blockAddr + this.sectorsOfBitmap + beginSectorId
|
||||||
|
|
||||||
debug(
|
debug(
|
||||||
`writeBlockSectors at ${offset} block=${
|
`writeBlockSectors at ${offset} block=${block.id}, sectors=${beginSectorId}...${endSectorId}`
|
||||||
block.id
|
|
||||||
}, sectors=${beginSectorId}...${endSectorId}`
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for (let i = beginSectorId; i < endSectorId; ++i) {
|
for (let i = beginSectorId; i < endSectorId; ++i) {
|
||||||
|
|||||||
@@ -230,9 +230,7 @@ class AuthLdap {
|
|||||||
logger(`attempting to bind as ${entry.objectName}`)
|
logger(`attempting to bind as ${entry.objectName}`)
|
||||||
await bind(entry.objectName, password)
|
await bind(entry.objectName, password)
|
||||||
logger(
|
logger(
|
||||||
`successfully bound as ${
|
`successfully bound as ${entry.objectName} => ${username} authenticated`
|
||||||
entry.objectName
|
|
||||||
} => ${username} authenticated`
|
|
||||||
)
|
)
|
||||||
logger(JSON.stringify(entry, null, 2))
|
logger(JSON.stringify(entry, null, 2))
|
||||||
return { username }
|
return { username }
|
||||||
|
|||||||
@@ -357,9 +357,7 @@ class BackupReportsXoPlugin {
|
|||||||
nagiosStatus: log.status === 'success' ? 0 : 2,
|
nagiosStatus: log.status === 'success' ? 0 : 2,
|
||||||
nagiosMarkdown:
|
nagiosMarkdown:
|
||||||
log.status === 'success'
|
log.status === 'success'
|
||||||
? `[Xen Orchestra] [Success] Metadata backup report for ${
|
? `[Xen Orchestra] [Success] Metadata backup report for ${log.jobName}`
|
||||||
log.jobName
|
|
||||||
}`
|
|
||||||
: `[Xen Orchestra] [${log.status}] Metadata backup report for ${
|
: `[Xen Orchestra] [${log.status}] Metadata backup report for ${
|
||||||
log.jobName
|
log.jobName
|
||||||
} - ${nagiosText.join(' ')}`,
|
} - ${nagiosText.join(' ')}`,
|
||||||
@@ -393,9 +391,7 @@ class BackupReportsXoPlugin {
|
|||||||
} − Backup report for ${jobName} ${STATUS_ICON[log.status]}`,
|
} − Backup report for ${jobName} ${STATUS_ICON[log.status]}`,
|
||||||
markdown: toMarkdown(markdown),
|
markdown: toMarkdown(markdown),
|
||||||
nagiosStatus: 2,
|
nagiosStatus: 2,
|
||||||
nagiosMarkdown: `[Xen Orchestra] [${
|
nagiosMarkdown: `[Xen Orchestra] [${log.status}] Backup report for ${jobName} - Error : ${log.result.message}`,
|
||||||
log.status
|
|
||||||
}] Backup report for ${jobName} - Error : ${log.result.message}`,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -713,9 +709,7 @@ class BackupReportsXoPlugin {
|
|||||||
subject: `[Xen Orchestra] ${globalStatus} ${icon}`,
|
subject: `[Xen Orchestra] ${globalStatus} ${icon}`,
|
||||||
markdown,
|
markdown,
|
||||||
nagiosStatus: 2,
|
nagiosStatus: 2,
|
||||||
nagiosMarkdown: `[Xen Orchestra] [${globalStatus}] Error : ${
|
nagiosMarkdown: `[Xen Orchestra] [${globalStatus}] Error : ${error.message}`,
|
||||||
error.message
|
|
||||||
}`,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,9 +189,7 @@ export default class DensityPlan extends Plan {
|
|||||||
const { vm, destination } = move
|
const { vm, destination } = move
|
||||||
const xapiDest = this.xo.getXapi(destination)
|
const xapiDest = this.xo.getXapi(destination)
|
||||||
debug(
|
debug(
|
||||||
`Migrate VM (${vm.id}) to Host (${destination.id}) from Host (${
|
`Migrate VM (${vm.id}) to Host (${destination.id}) from Host (${vm.$container}).`
|
||||||
vm.$container
|
|
||||||
}).`
|
|
||||||
)
|
)
|
||||||
return xapiDest.migrateVm(
|
return xapiDest.migrateVm(
|
||||||
vm._xapiId,
|
vm._xapiId,
|
||||||
|
|||||||
@@ -126,9 +126,7 @@ export default class PerformancePlan extends Plan {
|
|||||||
destinationAverages.memoryFree -= vmAverages.memory
|
destinationAverages.memoryFree -= vmAverages.memory
|
||||||
|
|
||||||
debug(
|
debug(
|
||||||
`Migrate VM (${vm.id}) to Host (${destination.id}) from Host (${
|
`Migrate VM (${vm.id}) to Host (${destination.id}) from Host (${exceededHost.id}).`
|
||||||
exceededHost.id
|
|
||||||
}).`
|
|
||||||
)
|
)
|
||||||
optimizationsCount++
|
optimizationsCount++
|
||||||
|
|
||||||
@@ -143,9 +141,7 @@ export default class PerformancePlan extends Plan {
|
|||||||
|
|
||||||
await Promise.all(promises)
|
await Promise.all(promises)
|
||||||
debug(
|
debug(
|
||||||
`Performance mode: ${optimizationsCount} optimizations for Host (${
|
`Performance mode: ${optimizationsCount} optimizations for Host (${exceededHost.id}).`
|
||||||
exceededHost.id
|
|
||||||
}).`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,9 +183,7 @@ export const configurationSchema = {
|
|||||||
description: Object.keys(HOST_FUNCTIONS)
|
description: Object.keys(HOST_FUNCTIONS)
|
||||||
.map(
|
.map(
|
||||||
k =>
|
k =>
|
||||||
` * ${k} (${HOST_FUNCTIONS[k].unit}): ${
|
` * ${k} (${HOST_FUNCTIONS[k].unit}): ${HOST_FUNCTIONS[k].description}`
|
||||||
HOST_FUNCTIONS[k].description
|
|
||||||
}`
|
|
||||||
)
|
)
|
||||||
.join('\n'),
|
.join('\n'),
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@@ -233,9 +231,7 @@ export const configurationSchema = {
|
|||||||
description: Object.keys(VM_FUNCTIONS)
|
description: Object.keys(VM_FUNCTIONS)
|
||||||
.map(
|
.map(
|
||||||
k =>
|
k =>
|
||||||
` * ${k} (${VM_FUNCTIONS[k].unit}): ${
|
` * ${k} (${VM_FUNCTIONS[k].unit}): ${VM_FUNCTIONS[k].description}`
|
||||||
VM_FUNCTIONS[k].description
|
|
||||||
}`
|
|
||||||
)
|
)
|
||||||
.join('\n'),
|
.join('\n'),
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@@ -284,9 +280,7 @@ export const configurationSchema = {
|
|||||||
description: Object.keys(SR_FUNCTIONS)
|
description: Object.keys(SR_FUNCTIONS)
|
||||||
.map(
|
.map(
|
||||||
k =>
|
k =>
|
||||||
` * ${k} (${SR_FUNCTIONS[k].unit}): ${
|
` * ${k} (${SR_FUNCTIONS[k].unit}): ${SR_FUNCTIONS[k].description}`
|
||||||
SR_FUNCTIONS[k].description
|
|
||||||
}`
|
|
||||||
)
|
)
|
||||||
.join('\n'),
|
.join('\n'),
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@@ -414,9 +408,7 @@ ${monitorBodies.join('\n')}`
|
|||||||
}
|
}
|
||||||
|
|
||||||
_parseDefinition(definition) {
|
_parseDefinition(definition) {
|
||||||
const alarmId = `${definition.objectType}|${definition.variableName}|${
|
const alarmId = `${definition.objectType}|${definition.variableName}|${definition.alarmTriggerLevel}`
|
||||||
definition.alarmTriggerLevel
|
|
||||||
}`
|
|
||||||
const typeFunction =
|
const typeFunction =
|
||||||
TYPE_FUNCTION_MAP[definition.objectType][definition.variableName]
|
TYPE_FUNCTION_MAP[definition.objectType][definition.variableName]
|
||||||
const parseData = (result, uuid) => {
|
const parseData = (result, uuid) => {
|
||||||
@@ -468,9 +460,7 @@ ${monitorBodies.join('\n')}`
|
|||||||
...definition,
|
...definition,
|
||||||
alarmId,
|
alarmId,
|
||||||
vmFunction: typeFunction,
|
vmFunction: typeFunction,
|
||||||
title: `${typeFunction.name} ${definition.comparator} ${
|
title: `${typeFunction.name} ${definition.comparator} ${definition.alarmTriggerLevel}${typeFunction.unit}`,
|
||||||
definition.alarmTriggerLevel
|
|
||||||
}${typeFunction.unit}`,
|
|
||||||
snapshot: async () => {
|
snapshot: async () => {
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
map(definition.uuids, async uuid => {
|
map(definition.uuids, async uuid => {
|
||||||
@@ -664,9 +654,7 @@ ${entry.listItem}
|
|||||||
subject: `[Xen Orchestra] − Performance Alert ${subjectSuffix}`,
|
subject: `[Xen Orchestra] − Performance Alert ${subjectSuffix}`,
|
||||||
markdown:
|
markdown:
|
||||||
markdownBody +
|
markdownBody +
|
||||||
`\n\n\nSent from Xen Orchestra [perf-alert plugin](${
|
`\n\n\nSent from Xen Orchestra [perf-alert plugin](${this._configuration.baseUrl}#/settings/plugins)\n`,
|
||||||
this._configuration.baseUrl
|
|
||||||
}#/settings/plugins)\n`,
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
throw new Error('The email alert system has a configuration issue.')
|
throw new Error('The email alert system has a configuration issue.')
|
||||||
|
|||||||
@@ -185,9 +185,7 @@ class SDNController extends EventEmitter {
|
|||||||
forOwn(networks, async network => {
|
forOwn(networks, async network => {
|
||||||
if (network.other_config.private_pool_wide === 'true') {
|
if (network.other_config.private_pool_wide === 'true') {
|
||||||
log.debug(
|
log.debug(
|
||||||
`Adding network: '${network.name_label}' for pool: '${
|
`Adding network: '${network.name_label}' for pool: '${network.$pool.name_label}' to managed networks`
|
||||||
network.$pool.name_label
|
|
||||||
}' to managed networks`
|
|
||||||
)
|
)
|
||||||
const center = await this._electNewCenter(network, true)
|
const center = await this._electNewCenter(network, true)
|
||||||
this._poolNetworks.push({
|
this._poolNetworks.push({
|
||||||
@@ -245,9 +243,7 @@ class SDNController extends EventEmitter {
|
|||||||
const privateNetwork = await pool.$xapi._getOrWaitObject(privateNetworkRef)
|
const privateNetwork = await pool.$xapi._getOrWaitObject(privateNetworkRef)
|
||||||
|
|
||||||
log.info(
|
log.info(
|
||||||
`Private network '${
|
`Private network '${privateNetwork.name_label}' has been created for pool '${pool.name_label}'`
|
||||||
privateNetwork.name_label
|
|
||||||
}' has been created for pool '${pool.name_label}'`
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// For each pool's host, create a tunnel to the private network
|
// For each pool's host, create a tunnel to the private network
|
||||||
@@ -298,9 +294,7 @@ class SDNController extends EventEmitter {
|
|||||||
|
|
||||||
if ($type === 'host') {
|
if ($type === 'host') {
|
||||||
log.debug(
|
log.debug(
|
||||||
`New host: '${object.name_label}' in pool: '${
|
`New host: '${object.name_label}' in pool: '${object.$pool.name_label}'`
|
||||||
object.$pool.name_label
|
|
||||||
}'`
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (find(this._newHosts, { $ref: object.$ref }) == null) {
|
if (find(this._newHosts, { $ref: object.$ref }) == null) {
|
||||||
@@ -383,11 +377,7 @@ class SDNController extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.debug(
|
log.debug(
|
||||||
`PIF: '${pif.device}' of network: '${
|
`PIF: '${pif.device}' of network: '${pif.$network.name_label}' star-center host: '${pif.$host.name_label}' has been unplugged, electing a new host`
|
||||||
pif.$network.name_label
|
|
||||||
}' star-center host: '${
|
|
||||||
pif.$host.name_label
|
|
||||||
}' has been unplugged, electing a new host`
|
|
||||||
)
|
)
|
||||||
const newCenter = await this._electNewCenter(pif.$network, true)
|
const newCenter = await this._electNewCenter(pif.$network, true)
|
||||||
poolNetwork.starCenter = newCenter ? newCenter.$ref : null
|
poolNetwork.starCenter = newCenter ? newCenter.$ref : null
|
||||||
@@ -399,18 +389,14 @@ class SDNController extends EventEmitter {
|
|||||||
if (poolNetwork.starCenter == null) {
|
if (poolNetwork.starCenter == null) {
|
||||||
const host = pif.$host
|
const host = pif.$host
|
||||||
log.debug(
|
log.debug(
|
||||||
`First available host: '${
|
`First available host: '${host.name_label}' becomes star center of network: '${pif.$network.name_label}'`
|
||||||
host.name_label
|
|
||||||
}' becomes star center of network: '${pif.$network.name_label}'`
|
|
||||||
)
|
)
|
||||||
poolNetwork.starCenter = pif.host
|
poolNetwork.starCenter = pif.host
|
||||||
this._starCenters.set(host.$id, host.$ref)
|
this._starCenters.set(host.$id, host.$ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug(
|
log.debug(
|
||||||
`PIF: '${pif.device}' of network: '${pif.$network.name_label}' host: '${
|
`PIF: '${pif.device}' of network: '${pif.$network.name_label}' host: '${pif.$host.name_label}' has been plugged`
|
||||||
pif.$host.name_label
|
|
||||||
}' has been plugged`
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const starCenter = await pif.$xapi._getOrWaitObject(
|
const starCenter = await pif.$xapi._getOrWaitObject(
|
||||||
@@ -436,9 +422,7 @@ class SDNController extends EventEmitter {
|
|||||||
await xapi.call('pool.certificate_sync')
|
await xapi.call('pool.certificate_sync')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(
|
log.error(
|
||||||
`Couldn't sync SDN controller ca certificate in pool: '${
|
`Couldn't sync SDN controller ca certificate in pool: '${host.$pool.name_label}' because: ${error}`
|
||||||
host.$pool.name_label
|
|
||||||
}' because: ${error}`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -460,17 +444,13 @@ class SDNController extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.debug(
|
log.debug(
|
||||||
`Pluging PIF: '${accessPIF.device}' for host: '${
|
`Pluging PIF: '${accessPIF.device}' for host: '${host.name_label}' on network: '${accessPIF.$network.name_label}'`
|
||||||
host.name_label
|
|
||||||
}' on network: '${accessPIF.$network.name_label}'`
|
|
||||||
)
|
)
|
||||||
try {
|
try {
|
||||||
await xapi.call('PIF.plug', accessPIF.$ref)
|
await xapi.call('PIF.plug', accessPIF.$ref)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(
|
log.error(
|
||||||
`XAPI error while pluging PIF: '${accessPIF.device}' on host: '${
|
`XAPI error while pluging PIF: '${accessPIF.device}' on host: '${host.name_label}' for network: '${accessPIF.$network.name_label}'`
|
||||||
host.name_label
|
|
||||||
}' for network: '${accessPIF.$network.name_label}'`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -484,11 +464,7 @@ class SDNController extends EventEmitter {
|
|||||||
for (const poolNetwork of poolNetworks) {
|
for (const poolNetwork of poolNetworks) {
|
||||||
const network = await host.$xapi._getOrWaitObject(poolNetwork.network)
|
const network = await host.$xapi._getOrWaitObject(poolNetwork.network)
|
||||||
log.debug(
|
log.debug(
|
||||||
`Star center host: '${host.name_label}' of network: '${
|
`Star center host: '${host.name_label}' of network: '${network.name_label}' in pool: '${host.$pool.name_label}' is no longer reachable, electing a new host`
|
||||||
network.name_label
|
|
||||||
}' in pool: '${
|
|
||||||
host.$pool.name_label
|
|
||||||
}' is no longer reachable, electing a new host`
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const newCenter = await this._electNewCenter(network, true)
|
const newCenter = await this._electNewCenter(network, true)
|
||||||
@@ -541,9 +517,7 @@ class SDNController extends EventEmitter {
|
|||||||
} else if (this._overrideCerts) {
|
} else if (this._overrideCerts) {
|
||||||
await xapi.call('pool.certificate_uninstall', SDN_CONTROLLER_CERT)
|
await xapi.call('pool.certificate_uninstall', SDN_CONTROLLER_CERT)
|
||||||
log.debug(
|
log.debug(
|
||||||
`Old SDN Controller CA certificate uninstalled on pool: '${
|
`Old SDN Controller CA certificate uninstalled on pool: '${xapi.pool.name_label}'`
|
||||||
xapi.pool.name_label
|
|
||||||
}'`
|
|
||||||
)
|
)
|
||||||
needInstall = true
|
needInstall = true
|
||||||
}
|
}
|
||||||
@@ -564,15 +538,11 @@ class SDNController extends EventEmitter {
|
|||||||
)
|
)
|
||||||
await xapi.call('pool.certificate_sync')
|
await xapi.call('pool.certificate_sync')
|
||||||
log.debug(
|
log.debug(
|
||||||
`SDN controller CA certificate install in pool: '${
|
`SDN controller CA certificate install in pool: '${xapi.pool.name_label}'`
|
||||||
xapi.pool.name_label
|
|
||||||
}'`
|
|
||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(
|
log.error(
|
||||||
`Couldn't install SDN controller CA certificate in pool: '${
|
`Couldn't install SDN controller CA certificate in pool: '${xapi.pool.name_label}' because: ${error}`
|
||||||
xapi.pool.name_label
|
|
||||||
}' because: ${error}`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -594,9 +564,7 @@ class SDNController extends EventEmitter {
|
|||||||
await hostClient.resetForNetwork(network.uuid, network.name_label)
|
await hostClient.resetForNetwork(network.uuid, network.name_label)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(
|
log.error(
|
||||||
`Couldn't reset network: '${network.name_label}' for host: '${
|
`Couldn't reset network: '${network.name_label}' for host: '${host.name_label}' in pool: '${network.$pool.name_label}' because: ${error}`
|
||||||
host.name_label
|
|
||||||
}' in pool: '${network.$pool.name_label}' because: ${error}`
|
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -616,11 +584,7 @@ class SDNController extends EventEmitter {
|
|||||||
|
|
||||||
if (newCenter == null) {
|
if (newCenter == null) {
|
||||||
log.error(
|
log.error(
|
||||||
`Unable to elect a new star-center host to network: '${
|
`Unable to elect a new star-center host to network: '${network.name_label}' for pool: '${network.$pool.name_label}' because there's no available host`
|
||||||
network.name_label
|
|
||||||
}' for pool: '${
|
|
||||||
network.$pool.name_label
|
|
||||||
}' because there's no available host`
|
|
||||||
)
|
)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@@ -633,9 +597,7 @@ class SDNController extends EventEmitter {
|
|||||||
)
|
)
|
||||||
|
|
||||||
log.info(
|
log.info(
|
||||||
`New star center host elected: '${newCenter.name_label}' in network: '${
|
`New star center host elected: '${newCenter.name_label}' in network: '${network.name_label}'`
|
||||||
network.name_label
|
|
||||||
}'`
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return newCenter
|
return newCenter
|
||||||
@@ -647,18 +609,14 @@ class SDNController extends EventEmitter {
|
|||||||
)
|
)
|
||||||
if (pif == null) {
|
if (pif == null) {
|
||||||
log.error(
|
log.error(
|
||||||
`No PIF found to create tunnel on host: '${
|
`No PIF found to create tunnel on host: '${host.name_label}' for network: '${network.name_label}'`
|
||||||
host.name_label
|
|
||||||
}' for network: '${network.name_label}'`
|
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await host.$xapi.call('tunnel.create', pif.$ref, network.$ref)
|
await host.$xapi.call('tunnel.create', pif.$ref, network.$ref)
|
||||||
log.debug(
|
log.debug(
|
||||||
`Tunnel added on host '${host.name_label}' for network '${
|
`Tunnel added on host '${host.name_label}' for network '${network.name_label}'`
|
||||||
network.name_label
|
|
||||||
}'`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -706,9 +664,7 @@ class SDNController extends EventEmitter {
|
|||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(
|
log.error(
|
||||||
`Couldn't add host: '${host.name_label}' to network: '${
|
`Couldn't add host: '${host.name_label}' to network: '${network.name_label}' in pool: '${host.$pool.name_label}' because: ${error}`
|
||||||
network.name_label
|
|
||||||
}' in pool: '${host.$pool.name_label}' because: ${error}`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,18 +135,14 @@ export class OvsdbClient {
|
|||||||
|
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
log.error(
|
log.error(
|
||||||
`[${
|
`[${this._host.name_label}] Error while adding port: '${portName}' and interface: '${interfaceName}' to bridge: '${bridgeName}' on network: '${networkName}' because: ${error}: ${details}`
|
||||||
this._host.name_label
|
|
||||||
}] Error while adding port: '${portName}' and interface: '${interfaceName}' to bridge: '${bridgeName}' on network: '${networkName}' because: ${error}: ${details}`
|
|
||||||
)
|
)
|
||||||
socket.destroy()
|
socket.destroy()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug(
|
log.debug(
|
||||||
`[${
|
`[${this._host.name_label}] Port: '${portName}' and interface: '${interfaceName}' added to bridge: '${bridgeName}' on network: '${networkName}'`
|
||||||
this._host.name_label
|
|
||||||
}] Port: '${portName}' and interface: '${interfaceName}' added to bridge: '${bridgeName}' on network: '${networkName}'`
|
|
||||||
)
|
)
|
||||||
socket.destroy()
|
socket.destroy()
|
||||||
}
|
}
|
||||||
@@ -187,9 +183,7 @@ export class OvsdbClient {
|
|||||||
forOwn(selectResult.other_config[1], config => {
|
forOwn(selectResult.other_config[1], config => {
|
||||||
if (config[0] === 'private_pool_wide' && config[1] === 'true') {
|
if (config[0] === 'private_pool_wide' && config[1] === 'true') {
|
||||||
log.debug(
|
log.debug(
|
||||||
`[${this._host.name_label}] Adding port: '${
|
`[${this._host.name_label}] Adding port: '${selectResult.name}' to delete list from bridge: '${bridgeName}'`
|
||||||
selectResult.name
|
|
||||||
}' to delete list from bridge: '${bridgeName}'`
|
|
||||||
)
|
)
|
||||||
portsToDelete.push(['uuid', portUuid])
|
portsToDelete.push(['uuid', portUuid])
|
||||||
}
|
}
|
||||||
@@ -217,20 +211,14 @@ export class OvsdbClient {
|
|||||||
}
|
}
|
||||||
if (jsonObjects[0].error != null) {
|
if (jsonObjects[0].error != null) {
|
||||||
log.error(
|
log.error(
|
||||||
`[${
|
`[${this._host.name_label}] Couldn't delete ports from bridge: '${bridgeName}' because: ${jsonObjects.error}`
|
||||||
this._host.name_label
|
|
||||||
}] Couldn't delete ports from bridge: '${bridgeName}' because: ${
|
|
||||||
jsonObjects.error
|
|
||||||
}`
|
|
||||||
)
|
)
|
||||||
socket.destroy()
|
socket.destroy()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug(
|
log.debug(
|
||||||
`[${this._host.name_label}] Deleted ${
|
`[${this._host.name_label}] Deleted ${jsonObjects[0].result[0].count} ports from bridge: '${bridgeName}'`
|
||||||
jsonObjects[0].result[0].count
|
|
||||||
} ports from bridge: '${bridgeName}'`
|
|
||||||
)
|
)
|
||||||
socket.destroy()
|
socket.destroy()
|
||||||
}
|
}
|
||||||
@@ -288,9 +276,7 @@ export class OvsdbClient {
|
|||||||
const bridgeUuid = selectResult._uuid[1]
|
const bridgeUuid = selectResult._uuid[1]
|
||||||
const bridgeName = selectResult.name
|
const bridgeName = selectResult.name
|
||||||
log.debug(
|
log.debug(
|
||||||
`[${
|
`[${this._host.name_label}] Found bridge: '${bridgeName}' for network: '${networkName}'`
|
||||||
this._host.name_label
|
|
||||||
}] Found bridge: '${bridgeName}' for network: '${networkName}'`
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return [bridgeUuid, bridgeName]
|
return [bridgeUuid, bridgeName]
|
||||||
@@ -398,20 +384,14 @@ export class OvsdbClient {
|
|||||||
const jsonResult = jsonObjects[0].result[0]
|
const jsonResult = jsonObjects[0].result[0]
|
||||||
if (jsonResult.error != null) {
|
if (jsonResult.error != null) {
|
||||||
log.error(
|
log.error(
|
||||||
`[${
|
`[${this._host.name_label}] Couldn't retrieve: '${columns}' in: '${table}' because: ${jsonResult.error}: ${jsonResult.details}`
|
||||||
this._host.name_label
|
|
||||||
}] Couldn't retrieve: '${columns}' in: '${table}' because: ${
|
|
||||||
jsonResult.error
|
|
||||||
}: ${jsonResult.details}`
|
|
||||||
)
|
)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jsonResult.rows.length === 0) {
|
if (jsonResult.rows.length === 0) {
|
||||||
log.error(
|
log.error(
|
||||||
`[${
|
`[${this._host.name_label}] No '${columns}' found in: '${table}' where: '${where}'`
|
||||||
this._host.name_label
|
|
||||||
}] No '${columns}' found in: '${table}' where: '${where}'`
|
|
||||||
)
|
)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@@ -419,9 +399,7 @@ export class OvsdbClient {
|
|||||||
// For now all select operations should return only 1 row
|
// For now all select operations should return only 1 row
|
||||||
assert(
|
assert(
|
||||||
jsonResult.rows.length === 1,
|
jsonResult.rows.length === 1,
|
||||||
`[${
|
`[${this._host.name_label}] There should exactly 1 row when searching: '${columns}' in: '${table}' where: '${where}'`
|
||||||
this._host.name_label
|
|
||||||
}] There should exactly 1 row when searching: '${columns}' in: '${table}' where: '${where}'`
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return jsonResult.rows[0]
|
return jsonResult.rows[0]
|
||||||
@@ -455,9 +433,7 @@ export class OvsdbClient {
|
|||||||
result = await fromEvent(stream, 'data', {})
|
result = await fromEvent(stream, 'data', {})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(
|
log.error(
|
||||||
`[${
|
`[${this._host.name_label}] Error while waiting for stream data: ${error}`
|
||||||
this._host.name_label
|
|
||||||
}] Error while waiting for stream data: ${error}`
|
|
||||||
)
|
)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@@ -487,9 +463,7 @@ export class OvsdbClient {
|
|||||||
await fromEvent(socket, 'secureConnect', {})
|
await fromEvent(socket, 'secureConnect', {})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(
|
log.error(
|
||||||
`[${this._host.name_label}] TLS connection failed because: ${error}: ${
|
`[${this._host.name_label}] TLS connection failed because: ${error}: ${error.code}`
|
||||||
error.code
|
|
||||||
}`
|
|
||||||
)
|
)
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
@@ -498,9 +472,7 @@ export class OvsdbClient {
|
|||||||
|
|
||||||
socket.on('error', error => {
|
socket.on('error', error => {
|
||||||
log.error(
|
log.error(
|
||||||
`[${
|
`[${this._host.name_label}] OVSDB client socket error: ${error} with code: ${error.code}`
|
||||||
this._host.name_label
|
|
||||||
}] OVSDB client socket error: ${error} with code: ${error.code}`
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -168,9 +168,7 @@ export async function mergeInto({ source, target, force }) {
|
|||||||
|
|
||||||
if (sourceHost.productBrand !== targetHost.productBrand) {
|
if (sourceHost.productBrand !== targetHost.productBrand) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`a ${sourceHost.productBrand} pool cannot be merged into a ${
|
`a ${sourceHost.productBrand} pool cannot be merged into a ${targetHost.productBrand} pool`
|
||||||
targetHost.productBrand
|
|
||||||
} pool`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -446,9 +446,7 @@ const createNetworkAndInsertHosts = defer(async function(
|
|||||||
})
|
})
|
||||||
if (result.exit !== 0) {
|
if (result.exit !== 0) {
|
||||||
throw invalidParameters(
|
throw invalidParameters(
|
||||||
`Could not ping ${master.name_label}->${
|
`Could not ping ${master.name_label}->${address.pif.$host.name_label} (${address.address}) \n${result.stdout}`
|
||||||
address.pif.$host.name_label
|
|
||||||
} (${address.address}) \n${result.stdout}`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1050,9 +1048,7 @@ export async function replaceBrick({
|
|||||||
CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 1 }
|
CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 1 }
|
||||||
await glusterCmd(
|
await glusterCmd(
|
||||||
glusterEndpoint,
|
glusterEndpoint,
|
||||||
`volume replace-brick xosan ${previousBrick} ${
|
`volume replace-brick xosan ${previousBrick} ${addressAndHost.brickName} commit force`
|
||||||
addressAndHost.brickName
|
|
||||||
} commit force`
|
|
||||||
)
|
)
|
||||||
await glusterCmd(glusterEndpoint, 'peer detach ' + previousIp)
|
await glusterCmd(glusterEndpoint, 'peer detach ' + previousIp)
|
||||||
data.nodes.splice(nodeIndex, 1, {
|
data.nodes.splice(nodeIndex, 1, {
|
||||||
@@ -1126,9 +1122,7 @@ async function _prepareGlusterVm(
|
|||||||
}
|
}
|
||||||
await newVM.add_tags('XOSAN')
|
await newVM.add_tags('XOSAN')
|
||||||
await xapi.editVm(newVM, {
|
await xapi.editVm(newVM, {
|
||||||
name_label: `XOSAN - ${lvmSr.name_label} - ${
|
name_label: `XOSAN - ${lvmSr.name_label} - ${host.name_label} ${labelSuffix}`,
|
||||||
host.name_label
|
|
||||||
} ${labelSuffix}`,
|
|
||||||
name_description: 'Xosan VM storage',
|
name_description: 'Xosan VM storage',
|
||||||
memory: memorySize,
|
memory: memorySize,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ export default function proxyConsole(ws, vmConsole, sessionId) {
|
|||||||
hostname = address
|
hostname = address
|
||||||
|
|
||||||
log.warn(
|
log.warn(
|
||||||
`host is missing in console (${vmConsole.uuid}) URI (${
|
`host is missing in console (${vmConsole.uuid}) URI (${vmConsole.location}) using host address (${address}) as fallback`
|
||||||
vmConsole.location
|
|
||||||
}) using host address (${address}) as fallback`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1724,9 +1724,7 @@ export default class Xapi extends XapiBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.debug(
|
log.debug(
|
||||||
`Moving VDI ${vdi.name_label} from ${vdi.$SR.name_label} to ${
|
`Moving VDI ${vdi.name_label} from ${vdi.$SR.name_label} to ${sr.name_label}`
|
||||||
sr.name_label
|
|
||||||
}`
|
|
||||||
)
|
)
|
||||||
try {
|
try {
|
||||||
await pRetry(
|
await pRetry(
|
||||||
|
|||||||
@@ -256,16 +256,12 @@ export default {
|
|||||||
) {
|
) {
|
||||||
if (getAll) {
|
if (getAll) {
|
||||||
log(
|
log(
|
||||||
`patch ${
|
`patch ${patch.name} (${id}) conflicts with installed patch ${conflictId}`
|
||||||
patch.name
|
|
||||||
} (${id}) conflicts with installed patch ${conflictId}`
|
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`patch ${
|
`patch ${patch.name} (${id}) conflicts with installed patch ${conflictId}`
|
||||||
patch.name
|
|
||||||
} (${id}) conflicts with installed patch ${conflictId}`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,9 +288,7 @@ export default {
|
|||||||
if (!installed[id] && find(installable, { id }) === undefined) {
|
if (!installed[id] && find(installable, { id }) === undefined) {
|
||||||
if (requiredPatch.paid && freeHost) {
|
if (requiredPatch.paid && freeHost) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`required patch ${
|
`required patch ${requiredPatch.name} (${id}) requires a XenServer license`
|
||||||
requiredPatch.name
|
|
||||||
} (${id}) requires a XenServer license`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
installable.push(requiredPatch)
|
installable.push(requiredPatch)
|
||||||
|
|||||||
@@ -411,9 +411,7 @@ export default class {
|
|||||||
localBaseUuid,
|
localBaseUuid,
|
||||||
{
|
{
|
||||||
bypassVdiChainsCheck: force,
|
bypassVdiChainsCheck: force,
|
||||||
snapshotNameLabel: `XO_DELTA_EXPORT: ${targetSr.name_label} (${
|
snapshotNameLabel: `XO_DELTA_EXPORT: ${targetSr.name_label} (${targetSr.uuid})`,
|
||||||
targetSr.uuid
|
|
||||||
})`,
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
$defer.onFailure(() => srcXapi.deleteVm(delta.vm.uuid))
|
$defer.onFailure(() => srcXapi.deleteVm(delta.vm.uuid))
|
||||||
|
|||||||
@@ -204,9 +204,7 @@ export default class metadataBackup {
|
|||||||
|
|
||||||
await asyncMap(handlers, async (handler, remoteId) => {
|
await asyncMap(handlers, async (handler, remoteId) => {
|
||||||
const subTaskId = logger.notice(
|
const subTaskId = logger.notice(
|
||||||
`Starting XO metadata backup for the remote (${remoteId}). (${
|
`Starting XO metadata backup for the remote (${remoteId}). (${job.id})`,
|
||||||
job.id
|
|
||||||
})`,
|
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
id: remoteId,
|
id: remoteId,
|
||||||
@@ -244,9 +242,7 @@ export default class metadataBackup {
|
|||||||
)
|
)
|
||||||
|
|
||||||
logger.notice(
|
logger.notice(
|
||||||
`Backuping XO metadata for the remote (${remoteId}) is a success. (${
|
`Backuping XO metadata for the remote (${remoteId}) is a success. (${job.id})`,
|
||||||
job.id
|
|
||||||
})`,
|
|
||||||
{
|
{
|
||||||
event: 'task.end',
|
event: 'task.end',
|
||||||
status: 'success',
|
status: 'success',
|
||||||
@@ -265,9 +261,7 @@ export default class metadataBackup {
|
|||||||
})
|
})
|
||||||
|
|
||||||
logger.error(
|
logger.error(
|
||||||
`Backuping XO metadata for the remote (${remoteId}) has failed. (${
|
`Backuping XO metadata for the remote (${remoteId}) has failed. (${job.id})`,
|
||||||
job.id
|
|
||||||
})`,
|
|
||||||
{
|
{
|
||||||
event: 'task.end',
|
event: 'task.end',
|
||||||
result: serializeError(error),
|
result: serializeError(error),
|
||||||
@@ -340,9 +334,7 @@ export default class metadataBackup {
|
|||||||
|
|
||||||
await asyncMap(handlers, async (handler, remoteId) => {
|
await asyncMap(handlers, async (handler, remoteId) => {
|
||||||
const subTaskId = logger.notice(
|
const subTaskId = logger.notice(
|
||||||
`Starting metadata backup for the pool (${poolId}) for the remote (${remoteId}). (${
|
`Starting metadata backup for the pool (${poolId}) for the remote (${remoteId}). (${job.id})`,
|
||||||
job.id
|
|
||||||
})`,
|
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
id: remoteId,
|
id: remoteId,
|
||||||
@@ -392,9 +384,7 @@ export default class metadataBackup {
|
|||||||
)
|
)
|
||||||
|
|
||||||
logger.notice(
|
logger.notice(
|
||||||
`Backuping pool metadata (${poolId}) for the remote (${remoteId}) is a success. (${
|
`Backuping pool metadata (${poolId}) for the remote (${remoteId}) is a success. (${job.id})`,
|
||||||
job.id
|
|
||||||
})`,
|
|
||||||
{
|
{
|
||||||
event: 'task.end',
|
event: 'task.end',
|
||||||
status: 'success',
|
status: 'success',
|
||||||
@@ -416,9 +406,7 @@ export default class metadataBackup {
|
|||||||
})
|
})
|
||||||
|
|
||||||
logger.error(
|
logger.error(
|
||||||
`Backuping pool metadata (${poolId}) for the remote (${remoteId}) has failed. (${
|
`Backuping pool metadata (${poolId}) for the remote (${remoteId}) has failed. (${job.id})`,
|
||||||
job.id
|
|
||||||
})`,
|
|
||||||
{
|
{
|
||||||
event: 'task.end',
|
event: 'task.end',
|
||||||
result: serializeError(error),
|
result: serializeError(error),
|
||||||
|
|||||||
@@ -25,12 +25,7 @@ import Upgrade from 'xoa-upgrade'
|
|||||||
import { Container, Row, Col } from 'grid'
|
import { Container, Row, Col } from 'grid'
|
||||||
import { injectIntl } from 'react-intl'
|
import { injectIntl } from 'react-intl'
|
||||||
import { SizeInput } from 'form'
|
import { SizeInput } from 'form'
|
||||||
import {
|
import { addSubscriptions, adminOnly, connectStore, resolveIds } from 'utils'
|
||||||
addSubscriptions,
|
|
||||||
adminOnly,
|
|
||||||
connectStore,
|
|
||||||
resolveIds
|
|
||||||
} from 'utils'
|
|
||||||
import {
|
import {
|
||||||
createGetObjectsOfType,
|
createGetObjectsOfType,
|
||||||
createSelector,
|
createSelector,
|
||||||
|
|||||||
Reference in New Issue
Block a user