Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(xo-web/import/esxi): import VM from ESXi #6663

Merged
merged 28 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
94fa3fe
Fix(@xen-orchestra/vmware-explorer): handle Esxi with more than 100 VMs
fbeauchamp Feb 20, 2023
d997f43
feat(xo-server): expose method for Esxi import UX
fbeauchamp Feb 20, 2023
dfa9e42
add missing file
fbeauchamp Feb 21, 2023
e3e0028
feat(xo-web/import/esxi): import VM from ESXI
Rajaa-BARHTAOUI Feb 8, 2023
1a52ab2
support selecting ESXI
Rajaa-BARHTAOUI Feb 8, 2023
77e81e3
improved code to increase readability
Rajaa-BARHTAOUI Feb 9, 2023
337efe8
improvement code
Rajaa-BARHTAOUI Feb 13, 2023
36f5308
fixes and remove unnecessary changes
Rajaa-BARHTAOUI Feb 13, 2023
3280f4a
refactor duplicate code
Rajaa-BARHTAOUI Feb 13, 2023
c7ddd09
handle when pool is undefined
Rajaa-BARHTAOUI Feb 13, 2023
6868c0d
minor changes
Rajaa-BARHTAOUI Feb 14, 2023
e195a60
handle ESXI import
Rajaa-BARHTAOUI Feb 14, 2023
f391a7f
fixes from feedbacks
Rajaa-BARHTAOUI Feb 14, 2023
8d81512
fixes from feedbacks
Rajaa-BARHTAOUI Feb 16, 2023
3d11cce
more fixes & remove unnecessary changes
Rajaa-BARHTAOUI Feb 16, 2023
b287975
fix ova/xva import
Rajaa-BARHTAOUI Feb 17, 2023
440eead
vmId instead vmData
Rajaa-BARHTAOUI Feb 17, 2023
1d3f1ef
remove unnecessary changes & code imrpoved
Rajaa-BARHTAOUI Feb 21, 2023
3f204b5
improve displayed VM config
Rajaa-BARHTAOUI Feb 21, 2023
af54ed4
changelog
Rajaa-BARHTAOUI Feb 21, 2023
e3edc46
fixes
Rajaa-BARHTAOUI Feb 21, 2023
8d13f9a
fixes from feedback
Rajaa-BARHTAOUI Feb 23, 2023
4b8aec8
remove unnecassary changes
Rajaa-BARHTAOUI Feb 23, 2023
17efadf
fixes from feedback
Rajaa-BARHTAOUI Feb 23, 2023
3bba78f
remove unnecassary changes
Rajaa-BARHTAOUI Feb 23, 2023
5f62f71
remove unnecassary changes
Rajaa-BARHTAOUI Feb 23, 2023
cf17c77
fix(xo-web): update method to reflect changes in PR #6662
fbeauchamp Feb 24, 2023
b670d6c
Merge branch 'master' into importEsxiUI
pdonias Feb 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

> Users must be able to say: “Nice enhancement, I'm eager to test it”

- [Import VM] Ability to import a VM from ESXi (PR [#6663](https://github.com/vatesfr/xen-orchestra/pull/6663))

### Bug fixes

> Users must be able to say: “I had this issue, happy to know it's fixed”
Expand All @@ -27,4 +29,6 @@

<!--packages-start-->

- xo-web minor

<!--packages-end-->
4 changes: 2 additions & 2 deletions packages/xo-web/src/common/intl/locales/es.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 @@ -1608,13 +1611,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 @@ -1636,6 +1642,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
Original file line number Diff line number Diff line change
Expand Up @@ -3468,3 +3468,10 @@ export const synchronizeNetbox = pools =>
body: _('syncNetboxWarning'),
icon: 'refresh',
}).then(() => _call('netbox.synchronize', { pools: resolveIds(pools) }))

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

export const esxiConnect = (host, user, password, sslVerify) =>
_call('esxi.connect', { 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading