Skip to content

Commit

Permalink
feat(xo-web/import/esxi): import VM from ESXi (#6663)
Browse files Browse the repository at this point in the history
See #6662
  • Loading branch information
Rajaa-BARHTAOUI authored and MathieuRA committed Mar 7, 2023
1 parent 80d0647 commit fc0c1ea
Show file tree
Hide file tree
Showing 18 changed files with 348 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Expand Up @@ -11,6 +11,7 @@
- [Continuous Replication] : add HealthCheck support to Continuous Replication (PR [#6668](https://github.com/vatesfr/xen-orchestra/pull/6668))
- [Plugin/auth-oidc] [OpenID Connect](<https://en.wikipedia.org/wiki/OpenID#OpenID_Connect_(OIDC)>) authentication plugin [#6641](https://github.com/vatesfr/xen-orchestra/issues/6641) (PR [#6684](https://github.com/vatesfr/xen-orchestra/issues/6684))
- [REST API] Possibility to start, shutdown, reboot and snapshot VMs
- [Import VM] Ability to import a VM from ESXi (PR [#6663](https://github.com/vatesfr/xen-orchestra/pull/6663))

### Bug fixes

Expand Down
4 changes: 2 additions & 2 deletions packages/xo-web/src/common/intl/locales/es.js
Expand Up @@ -2598,8 +2598,8 @@ export default {
// Original text: "To SR:"
vmImportToSr: 'al SR:',

// Original text: "VMs to import"
vmsToImport: 'VMs para importar',
// Original text: "VM{nVms, plural, one {} other {s}} to import"
vmsToImport: 'VM{nVms, plural, one {} other {s}} para importar',

// Original text: "Reset"
importVmsCleanList: 'Reiniciar',
Expand Down
4 changes: 2 additions & 2 deletions packages/xo-web/src/common/intl/locales/fr.js
Expand Up @@ -2657,8 +2657,8 @@ export default {
// Original text: "To SR:"
vmImportToSr: 'Sur le SR:',

// Original text: "VMs to import"
vmsToImport: 'VMs à importer',
// Original text: "VM{nVms, plural, one {} other {s}} to import"
vmsToImport: 'VM{nVms, plural, one {} other {s}} à importer',

// Original text: "Reset"
importVmsCleanList: 'Réinitialiser',
Expand Down
2 changes: 1 addition & 1 deletion packages/xo-web/src/common/intl/locales/he.js
Expand Up @@ -2276,7 +2276,7 @@ export default {
// Original text: 'To SR:'
vmImportToSr: undefined,

// Original text: 'VMs to import'
// Original text: 'VM{nVms, plural, one {} other {s}} to import'
vmsToImport: undefined,

// Original text: 'Reset'
Expand Down
2 changes: 1 addition & 1 deletion packages/xo-web/src/common/intl/locales/hu.js
Expand Up @@ -2490,7 +2490,7 @@ export default {
// Original text: "To SR:"
vmImportToSr: 'Adattárolóra:',

// Original text: "VMs to import"
// Original text: "VM{nVms, plural, one {} other {s}} to import"
vmsToImport: 'Importálandó VPS-el',

// Original text: "Reset"
Expand Down
4 changes: 2 additions & 2 deletions packages/xo-web/src/common/intl/locales/it.js
Expand Up @@ -3746,8 +3746,8 @@ export default {
// Original text: 'To SR:'
vmImportToSr: 'Per SR:',

// Original text: 'VMs to import'
vmsToImport: 'VMs da importare',
// Original text: 'VM{nVms, plural, one {} other {s}} to import'
vmsToImport: 'VM{nVms, plural, one {} other {s}} da importare',

// Original text: 'Reset'
importVmsCleanList: 'Ripristina',
Expand Down
4 changes: 2 additions & 2 deletions packages/xo-web/src/common/intl/locales/pl.js
Expand Up @@ -2280,8 +2280,8 @@ export default {
// Original text: "To SR:"
vmImportToSr: 'To SR:',

// Original text: "VMs to import"
vmsToImport: 'VMs to import',
// Original text: "VM{nVms, plural, one {} other {s}} to import"
vmsToImport: 'VM{nVms, plural, one {} other {s}} to import',

// Original text: "Reset"
importVmsCleanList: 'Reset',
Expand Down
4 changes: 2 additions & 2 deletions packages/xo-web/src/common/intl/locales/pt.js
Expand Up @@ -2279,8 +2279,8 @@ export default {
// Original text: "To SR:"
vmImportToSr: 'Enviar para SR:',

// Original text: "VMs to import"
vmsToImport: 'Importar VMs',
// Original text: "VM{nVms, plural, one {} other {s}} to import"
vmsToImport: 'Importar VM{nVms, plural, one {} other {s}} ',

// Original text: "Reset"
importVmsCleanList: 'Reiniciar',
Expand Down
2 changes: 1 addition & 1 deletion packages/xo-web/src/common/intl/locales/ru.js
Expand Up @@ -2600,7 +2600,7 @@ export default {
// Original text: "To SR:"
vmImportToSr: 'В SR:',

// Original text: "VMs to import"
// Original text: "VM{nVms, plural, one {} other {s}} to import"
vmsToImport: 'ВМ для импорта',

// Original text: "Reset"
Expand Down
2 changes: 1 addition & 1 deletion packages/xo-web/src/common/intl/locales/tr.js
Expand Up @@ -3223,7 +3223,7 @@ export default {
// Original text: "To SR:"
vmImportToSr: 'SR:',

// Original text: "VMs to import"
// Original text: "VM{nVms, plural, one {} other {s}} to import"
vmsToImport: "içe aktarılacak VM'ler",

// Original text: "Reset"
Expand Down
2 changes: 1 addition & 1 deletion packages/xo-web/src/common/intl/locales/zh.js
Expand Up @@ -1739,7 +1739,7 @@ export default {
// Original text: "To SR:"
vmImportToSr: '到存储库',

// Original text: "VMs to import"
// Original text: "VM{nVms, plural, one {} other {s}} to import"
vmsToImport: '导入虚拟机',

// Original text: "Reset"
Expand Down
9 changes: 8 additions & 1 deletion packages/xo-web/src/common/intl/messages.js
Expand Up @@ -9,7 +9,10 @@ const messages = {
description: 'Description',
deleteSourceVm: 'Delete source VM',
expiration: 'Expiration',
hostIp: 'Host IP',
keyValue: '{key}: {value}',
sslCertificate: 'SSL certificate',
vmSrUsage: 'Storage: {used} used of {total} ({free} free)',

notDefined: 'Not defined',
statusConnecting: 'Connecting',
Expand Down Expand Up @@ -1611,13 +1614,16 @@ const messages = {

// ---- VM import ---
fileType: 'File type:',
firmware: 'Firmware',
fromUrl: 'From URL',
fromVmware: 'From VMware',
importVmsList: 'Drop OVA or XVA files here to import Virtual Machines.',
noSelectedVms: 'No selected VMs.',
noToolsInstalled: 'No tools installed',
url: 'URL:',
vmImportToPool: 'To Pool:',
vmImportToSr: 'To SR:',
vmsToImport: 'VMs to import',
vmsToImport: 'VM{nVms, plural, one {} other {s}} to import',
importVmsCleanList: 'Reset',
vmImportSuccess: 'VM import success',
vmImportFailed: 'VM import failed',
Expand All @@ -1639,6 +1645,7 @@ const messages = {
vmImportError: 'Error:',
vmImportFileType: '{type} file:',
vmImportConfigAlert: 'Please check and/or modify the VM configuration.',
toolsInstalled: 'The tools are installed',

// ---- Disk import ---
diskImportFailed: 'Disk import failed',
Expand Down
7 changes: 7 additions & 0 deletions packages/xo-web/src/common/xo/index.js
Expand Up @@ -3491,3 +3491,10 @@ export const synchronizeNetbox = pools =>
body: _('syncNetboxWarning'),
icon: 'refresh',
}).then(() => _call('netbox.synchronize', { pools: resolveIds(pools) }))

// ESXi import ---------------------------------------------------------------

export const esxiListVms = (host, user, password, sslVerify) =>
_call('esxi.listVms', { host, user, password, sslVerify })

export const importVmFromEsxi = params => _call('vm.importFromEsxi', params)
5 changes: 5 additions & 0 deletions packages/xo-web/src/xo-app/import/index.js
Expand Up @@ -7,6 +7,7 @@ import { NavLink, NavTabs } from 'nav'
import { routes } from 'utils'

import DiskImport from '../disk-import'
import EsxiImport from '../vm-import/esxi/esxi-import'
import VmImport from '../vm-import'

const HEADER = (
Expand All @@ -25,6 +26,9 @@ const HEADER = (
<NavLink to='/import/disk'>
<Icon icon='disk' /> {_('labelDisk')}
</NavLink>
<NavLink to='/import/vmware'>
<Icon icon='vm' /> {_('fromVmware')}
</NavLink>
</NavTabs>
</Col>
</Row>
Expand All @@ -34,6 +38,7 @@ const HEADER = (
const Import = routes('vm', {
disk: DiskImport,
vm: VmImport,
vmware: EsxiImport,
})(({ children }) => (
<Page header={HEADER} title='newImport' formatTitle>
{children}
Expand Down
5 changes: 5 additions & 0 deletions packages/xo-web/src/xo-app/menu/index.js
Expand Up @@ -494,6 +494,11 @@ export default class Menu extends Component {
icon: 'disk',
label: 'labelDisk',
},
{
to: '/import/vmware',
icon: 'vm',
label: 'fromVmware',
},
],
},
!(noOperatablePools && noResourceSets) && {
Expand Down

0 comments on commit fc0c1ea

Please sign in to comment.