1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

19981 Commits

Author SHA1 Message Date
Daniel Clavijo Coca
c6307edc3b
F OpenNebula/one#5516: Add missing backup yamls to installer (#2339) 2022-11-07 10:50:58 +01:00
Ruben S. Montero
0a46e21129
F #5516: Incremental backups for qcow2 disk images
- Adds new configuration attribute MODE: FULL or INCREMENTAL for
  BACKUP_CONFIG. FULL backups uses a differen backup image.

- INCREMENTAL backup information is together with the backup image.
  Example:

      <BACKUP_INCREMENTS>
        <INCREMENT>
          <DATE><![CDATA[1667770552]]></DATE>
          <ID><![CDATA[0]]></ID>
          <PARENT_ID><![CDATA[-1]]></PARENT_ID>
          <SIZE><![CDATA[172]]></SIZE>
          <SOURCE><![CDATA[bb828060]]></SOURCE>
          <TYPE><![CDATA[FULL]]></TYPE>
        </INCREMENT>
        <INCREMENT>
          <DATE><![CDATA[1667770604]]></DATE>
          <ID><![CDATA[1]]></ID>
          <PARENT_ID><![CDATA[0]]></PARENT_ID>
          <SIZE><![CDATA[1]]></SIZE>
          <SOURCE><![CDATA[ca0de5f6]]></SOURCE>
          <TYPE><![CDATA[INCREMENT]]></TYPE>
        </INCREMENT>
        <INCREMENT>
          <DATE><![CDATA[1667770700]]></DATE>
          <ID><![CDATA[2]]></ID>
          <PARENT_ID><![CDATA[1]]></PARENT_ID>
          <SIZE><![CDATA[39]]></SIZE>
          <SOURCE><![CDATA[e9897d6a]]></SOURCE>
          <TYPE><![CDATA[INCREMENT]]></TYPE>
        </INCREMENT>
      </BACKUP_INCREMENTS>

    This information only appears on incremental backups

- Internal BACKUP_CONFIG data includes information about the current
  active backup and the last increment id.

- Backup operation includes a new parameter: reset. This "closes" the
  current active incremental chain and creates a new FULL backup.

- Backup drivers store backups with increment index (0 = FULL) e.g.
  disk.0.0.

- Incremental backups are only allowed for VMs using all disks in qcow2
  format.

- Backup configuration cannot be changed while doing a VM backup.

- Downloader strings includes backup chains <inc_id>:<backup_ref>,...

- Restic downloader  has been updated to support backup chains. Disk
  images are rebased across increments.
2022-11-06 22:54:36 +01:00
Jorge Miguel Lobo Escalona
f9b077fb55
M #~: retrieve OS attributes when instantiate vm template (#2338)
Co-authored-by: Jorge Lobo <jlobo@opennebula.systems>
2022-11-03 18:35:13 +01:00
Frederick Borges
61b920b505
F #5516: Add backup functionality and actions (#2337)
by hypervisor & vm state
2022-11-03 18:34:05 +01:00
onenhansen
51d5a95a95
F #5516: minor rsync fixes (#2331)
minor fixes for return code handling
adding a slash to the backup lib script path generation
2022-11-03 10:34:47 +01:00
Tino Vázquez
52c97b5b6b
L #-: Remove redundant each
(cherry picked from commit dc58f9b0e741eb8a546a3a700bf91cebee4881fd)
2022-11-02 16:37:21 +01:00
Jorge Miguel Lobo Escalona
c62fb1dffa
F #6003: show error message in vm tabs (#2336)
Co-authored-by: Jorge Lobo <jlobo@opennebula.systems>
2022-11-02 16:24:48 +01:00
Frederick Borges
7e1a81cc4b
B #5238: Fix disk resize on instantiate (#2335) 2022-11-02 16:12:16 +01:00
Pavel Czerný
c8da8a2ce5
M #-: Fix parsing of scheduled time (#2332) 2022-11-02 10:26:06 +01:00
Jan Orel
058acb0008
Revert: "M #-: Load sunstone yamls with aliases" (#2329) 2022-11-02 09:42:44 +01:00
Frederick Borges
524433a751
F #5516: Add backup-tab.yaml (#2330) 2022-10-31 11:31:48 +01:00
Kristian Feldsam
0c75c6db21
M #-: Sunstone - fixed showing IP6_GLOBAL addresses (#5956)
(cherry picked from commit b14e19186919f5d7c053c27b4b8820f5f81c647e)
2022-10-28 11:19:35 +02:00
Frederick Borges
ac86c6c28f
B #5993: Fix group creation on Alma9 (#2327) 2022-10-27 16:35:04 +02:00
Pavel Czerný
ceab1ed159
M #-: Fix xml-schema for backups (#2326) 2022-10-27 12:36:23 +02:00
Ruben S. Montero
57fe4c79e3
M #-: Missing pieces f62cd2c10c (6.6.0 versioning) 2022-10-27 11:40:57 +02:00
Frederick Borges
1f2e74b4d6
F #5516: Change BACKUP_POWEROFF state text on Sunstone (#2325) 2022-10-26 11:17:26 +02:00
Ruben S. Montero
50529b2770
M #-: Add more information in backup actions 2022-10-25 22:17:38 +02:00
Jorge Miguel Lobo Escalona
1563476aa1
B #~: update schedule icon (#2324) 2022-10-25 18:48:12 +02:00
Jan Orel
5973b126b9
M #-: Add explicit dependecy to aws host (#2312) 2022-10-24 11:03:35 +02:00
Ruben S. Montero
8e20d747c8
M #-: Increase qemu-img coroutines for backups
Disk images are consolidated and converted to qcow2 format before
backup. This commit increases the number of co-routines to increase the
parallelism of the operation
2022-10-21 16:55:20 +02:00
Tino Vázquez
f62cd2c10c
M #-: Downgrade version to 6.5.80 (#2314) 2022-10-21 14:27:45 +02:00
Jan Orel
e6826c823a
M #-: Fix rhel7 multipart-post and ruby comp. (#2315)
With multipart-post 2.2.0+:
irb(main):002:0> require 'net/http/post/multipart'
NoMethodError: undefined method `deprecate_constant' for Object:Class
2022-10-21 14:23:44 +02:00
Frederick Borges
39ea4624f9
F #5516: Fix Backup tab (#2317) 2022-10-21 14:08:08 +02:00
Jorge Miguel Lobo Escalona
54b77c4308
M #-: Fix image datatable (#2316) 2022-10-21 14:05:41 +02:00
Frederick Borges
b619854c3e
F #5516: Backup Functionality on FSunstone (#2313) 2022-10-21 13:33:31 +02:00
Tino Vázquez
2c3f629236
L #-: Adjust to new rubocop version 2022-10-21 12:34:22 +02:00
Jorge Miguel Lobo Escalona
2e49768d1e
M #~: fix redirect create vnet fireedge (#2311) 2022-10-19 12:22:02 +02:00
Pavel Czerný
c78e7f614b
B #5950: Fix RETIME one onevm recover --delete (#2267)
(cherry picked from commit 28924db84ba7b0f6c78e2ab754c4390b0c86aac3)
2022-10-19 09:37:27 +02:00
Jorge Miguel Lobo Escalona
f4326ea714
F #5998: Long labels in sunstone (#2310) 2022-10-18 17:53:24 +02:00
Christian González
cc6d44d773
M #: Add 'always' option for autostar host hook (#2303)
(cherry picked from commit 0b7e8fd5b9643fc962176044383558dfba3a735d)
2022-10-17 21:19:19 +02:00
Ruben S. Montero
bb8df9fcd8
M #-: Fix trunk VLAN IDs for OVS
When the VLAN range includes spaces (e.g. "1, 3 , 4 ,5") the tunk attribute for the port is not properly updated.

(cherry picked from commit 9a17e4b62d05b25cfaa5a8cc440c92ec41b3152d)
2022-10-17 21:17:14 +02:00
onenhansen
a3e5f015d4
F OpenNebula/one#5516: linting fixes for rsync (#2309) 2022-10-17 19:32:20 +02:00
Christian González
46b571387b
B #5991: Ensure VM snapshots are redefined in order (#2306)
(cherry picked from commit a963d3ac264d889bfe98351b5984c66669d00499)
2022-10-17 18:48:57 +02:00
Tino Vázquez
714b4de2db M #-: Remove smoke tests badge
It is confusing that it refers only to EE
2022-10-17 10:27:51 +02:00
Michal Opala
1ad0178909
F #-: Add prometheus-client gem + fix CentOS8 repos (#2308)
This commits adds prometheus client as dependency to support prometheus integration:
* Ubuntu1804
* Ubuntu2004
* Ubuntu2204
* Debian10
* Debian11
* AlmaLinux8
* AlmaLinux9
* CentOS7
* CentOS8
2022-10-14 19:42:58 +02:00
Jorge Miguel Lobo Escalona
39ceb78969
B #5983: fix min/max data type (#2307) 2022-10-14 10:21:28 +02:00
Jorge Miguel Lobo Escalona
66442e00a0
M #~: disable inputs restricted attributes (#2305) 2022-10-13 13:56:18 +02:00
Jorge Miguel Lobo Escalona
0f7f2b5ccc
M #~: delete restricted values user (#2302) 2022-10-11 10:34:12 +02:00
Tino Vázquez
6ba27387bc
L #-: Several linting fixes 2022-10-10 18:43:38 +02:00
Tino Vázquez
015c66e1a9
L #-: Several small linting fixes
(cherry picked from commit 21dc3c8e8c9cf9853f312024dff16fec6a4b12a2)
2022-10-10 18:37:01 +02:00
Frederick Borges
72704708ce
B #5970: Fix ignore volatile disks on VM instantiate (#2304) 2022-10-10 18:15:11 +02:00
Ruben S. Montero
eb5709baf2
M #-: Add missing change from F-5516 branch 2022-10-10 14:52:39 +02:00
Tino Vázquez
6f3d4b00dc
M #-: Minor adjustment in conf file 2022-10-10 13:46:56 +02:00
Alejandro Huertas Herrero
21f79176b9
B #5189: Recover bugfix lost with backup merge
(cherry picked from commit c37f2105bd78764ef7cd78fb49c5fc7f66957f63)
2022-10-08 03:16:26 +02:00
Ruben S. Montero
8ae2773e75
M #-: update install.sh with removed files 2022-10-08 02:13:14 +02:00
Ruben S. Montero
1e0f29ee42
M #-: Merge fixes 2022-10-08 00:38:06 +02:00
Ruben S. Montero
e433ccb85b
F #5516: New backup interface for OpenNebula
co-authored-by: Frederick Borges <fborges@opennebula.io>
co-authored-by: Neal Hansen <nhansen@opennebula.io>
co-authored-by: Daniel Clavijo Coca <dclavijo@opennebula.io>
co-authored-by: Pavel Czerný <pczerny@opennebula.systems>

BACKUP INTERFACE
=================

* Backups are exposed through a a special Datastore (BACKUP_DS) and
  Image (BACKUP) types. These new types can only be used for backup'ing
  up VMs. This approach allows to:

  - Implement tier based backup policies (backups made on different
    locations).

  - Leverage access control and quota systems

  - Support differnt storage and backup technologies

* Backup interface for the VMs:

  - VM configures backups with BACKUP_CONFIG. This attribute can be set
    in the VM template or updated with updateconf API call. It can include:

    + BACKUP_VOLATILE: To backup or not volatile disks

    + FS_FREEZE: How the FS is freeze for running VMs (qemu-agent,
      suspend or none). When possible backups are crash consistent.

    + KEEP_LAST: keep only a given number of backups.

  - Backups are initiated by the one.vm.backup API call that requires
    the target Datastore to perform the backup (one-shot). This is
    exposed by the onevm backup command.

  - Backups can be periodic through scheduled actions.

  - Backup configuration is updated with one.vm.updateconf API call.

* Restore interface:

  - Restores are initiated by the one.image.restore API call. This is
    exposed by oneimage restore command.

  - Restore include configurable options for the VM template

    + NO_IP: to not preserve IP addresses (but keep the NICs and network
      mapping)

    + NO_NIC: to not preserve network mappings

  - Other template attributes:

    + Clean PCI devices, including network configuration in case of TYPE=NIC
    attributes. By default it removes SHORT_ADDRESS and leave the "auto"
    selection attributes.

    + Clean NUMA_NODE, removes node id and cpu sets. It keeps the NUMA node

  - It is possible to restore single files stored in the repository by
    using the backup specific URL.

* Sunstone (Ruby version) has been updated to expose this feautres.

BACKUP DRIVERS & IMPLEMENTATION
===============================

* Backup operation is implemented by a combination of 3 driver operations:

  - VMM. New (internal oned <-> one_vmm_exec.rb) to orchestrate
    backups for RUNNING VMs.

  - TM. This commit introduces 2 new operations (and their
    corresponding _live variants):

    + pre_backup(_live): Prepares the disks to be back'ed up in the
      repository. It is specific to the driver: (i) ceph uses the export
      operation; (ii) qcow2/raw uses snapshot-create-as and fs_freeze as
      needed.
    + post_backup(_live): Performs cleanning operations, i.e. KVM
      snapshots or tmp dirs.

  - DATASTORE. Each backup technology is represented by its
    corresponfing driver, that needs to implement:

    + backup: it takes the VM disks in file (qcow2) format and stores it
      the backup repository.

    + restore: it takes a backup image and restores the associated disks
      and VM template.

    + monitor: to gather available space in the repository

    + rm: to remove existing backups

    + stat: to return the "restored" size of a disk stored in a backup

    + downloader pseudo-URL handler: in the form
      <backup_proto>://<driver_snapshot_id>/<disk filename>

BACKUP MANAGEMENT
=================

Backup actions may potentially take some time, leaving some vmm_exec threads in
use for a long time, stucking other vmm operations. Backups are planned
by the scheduler through the sched action interface.

Two attributes has been added to sched.conf:
  * MAX_BACKUPS max active backup operations in the cloud. No more
    backups will be started beyond this limit.

  * MAX_BACKUPS_HOST max number of backups per host

* Fix onevm CLI to properly show and manage schedule actions. --schedule
  supports now, as well as relative times +<seconds_from_stime>

  onvm backup --schedule now -d 100 63

* Backup is added as VM_ADMIN_ACTIONS in oned.conf. Regular users needs
  to use the batch interface or request specific permissions

Internal restructure of Scheduler:

- All sched_actions interface is now in SchedActionsXML class and files.
  This class uses references to VM XML, and MUST be used in the same
  lifetime scope.

- XMLRPC API calls for sched actions has been moved to ScheduledActionXML.cc as
  static functions.

- VirtualMachineActionPool includes counters for active backups (total
  and per host).

SUPPORTED PLATFORMS
====================
* hypervisor: KVM
* TM: qcow2/shared/ssh, ceph
* backup: restic, rsync

Notes on Ceph

* Ceph backups are performed in the following steps:
    1. A snapshot of each disk is taken (group snapshots cannot be used as
       it seems we cannot export the disks afterwards)
    2. Disks are export to a file
    3. File is converted to qcow2 format
    4. Disk files are upload to the backup repo

TODO:
  * Confirm crash consistent snapshots cannot be used in Ceph

TODO:
  * Check if using VM dir instead of full path is better to accomodate
    DS migrations i.e.:
    - Current path: /var/lib/one/datastores/100/53/backup/disk.0
    - Proposal: 53/backup/disk.0

RESTIC DRIVER
=============
Developed together with this feature is part of the EE edtion.

* It supports the SFTP protocol, the following attributes are
  supported:

  - RESTIC_SFTP_SERVER
  - RESTIC_SFTP_USER: only if different from oneadmin
  - RESTIC_PASSWORD
  - RESTIC_IONICE: Run restic under a given ionice priority (class 2)
  - RESTIC_NICE: Run restic under a given nice
  - RESTIC_BWLIMIT: Limit restic upload/download BW
  - RESTIC_COMPRESSION: Restic 0.14 implements compression (three modes:
    off, auto, max). This requires repositories version 2. By default,
    auto is used (average compression without to much CPU usage)
  - RESTIC_CONNECTIONS: Sets the number of concurrent connections to a
    backend (5 by default). For high-latency backends this number can be
    increased.

* downloader URL: restic://<datastore_id>/<snapshot_id>/<file_name>
  snapshot_id is the restic snapshot hash. To recover single disk images
  from a backup. This URLs support:

  - RESTIC_CONNECTIONS
  - RESTIC_BWLIMIT
  - RESTIC_IONICE
  - RESTIC_NICE

  These options needs to be defined in the associated datastore.

RSYNC DRIVER
=============
A rsync driver is included as part of the CE distribution. It uses the
rsync tool to store backups in a remote server through SSH:

* The following attributes are supported to configure the backup
  datastore:

  - RSYNC_HOST
  - RSYNC_USER
  - RSYNC_ARGS: Arguments to perform the rsync operatin (-aS by default)

* downloader URL: rsync://<ds_id>/<vmid>/<hash>/<file> can be used to recover
  single files from an existing backup. (RSYNC_HOST and RSYN_USER needs
  to be set in ds_id

EMULATOR_CPUS
=============

This commit includes a non related backup feature:

* Add EMULATOR_CPUS (KVM). This host (or cluster attribute) defines the
  CPU IDs where the emulator threads will be pinned. If this value is
  not defined the allocated CPU wll be used when using a PIN policy.

(cherry picked from commit a9e6a8e000e9a5a2f56f80ce622ad9ffc9fa032b)

F OpenNebula/one#5516: adding rsync backup driver

(cherry picked from commit fb52edf5d009dc02b071063afb97c6519b9e8305)

F OpenNebula/one#5516: update install.sh, add vmid to source, some polish

Signed-off-by: Neal Hansen <nhansen@opennebula.io>
(cherry picked from commit 6fc6f8a67e435f7f92d5c40fdc3d1c825ab5581d)

F OpenNebula/one#5516: cleanup

Signed-off-by: Neal Hansen <nhansen@opennebula.io>
(cherry picked from commit 12f4333b833f23098142cd4762eb9e6c505e1340)

F OpenNebula/one#5516: update downloader, default args, size check

Signed-off-by: Neal Hansen <nhansen@opennebula.io>
(cherry picked from commit 510124ef2780a4e2e8c3d128c9a42945be38a305)

LL

(cherry picked from commit d4fcd134dc293f2b862086936db4d552792539fa)
2022-10-07 22:01:37 +02:00
Ruben S. Montero
ae136f0d97
M #-: Better error messages for x509 driver
(cherry picked from commit 6e14f51ab90b39909a38486c2a36232a846f13fa)
2022-10-07 13:46:58 +02:00
Tino Vázquez
57403566b2
L #-: Change max line length in ruby scripts
from 80 to 100
2022-10-06 16:55:55 +02:00
Christian González
ab48cd242b
L #: Lint OneFlow files (#2300) 2022-10-06 16:40:54 +02:00