Commit Graph

79 Commits (master)

Author SHA1 Message Date
Takashi Kajinami 7e145f5624 Use LOG.warning instead of deprecated LOG.warn
The LOG.warn method is deprecated[1] and the LOG.warning method should
be used instead.

[1] https://docs.python.org/3/library/logging.html#logging.warning

Change-Id: I7e721580693a2d81b415a8ae0eb1963456d0195a
1 year ago
zhufl 5ed5b65993 Add missing print format and missing ws in log message
This is to add missing print format parameter and missing white
spaces in the log message.

Change-Id: I76f790f98a9f7f2c7f0cbbbed1d50f5ec057b8c8
3 years ago
gecong1973 73956bc73c fix a bug for _create_image
Change-Id: I305c9e76fe55740334c3c0a244ed5826a3f082a4
3 years ago
gecong1973 ad88e30ab0 fix a bug for get_backups
Change-Id: Ib5c8198af6722e85e16b4a0f20bbf1fb25bfbe94
3 years ago
gecong1973 03d3488abd add exception details for make_glance_image when exception raise
Change-Id: Ic0897ec562e27b154a9d4e8a2db55baa5768c35c
3 years ago
gecong1973 d08298f0c2 add exception details for provide_snapshot when RuntimeErro
Change-Id: I80b0ec7fc7ffeee964b4660060e7023da7bb6dc9
3 years ago
gecong1973 6bedeb78fa add remove_cinderbackup_older_than method for AdminOs
Change-Id: I4948a706cff1635fec950c718ffa0c0fcb624601
3 years ago
Caihui 6cb301b71a Use volume v3 API
Volume API v2 has been deprecated for a long time, use alternative version 3 instead.

Change-Id: I9586444e498340189be7ab13a34b7be3778c6f5f
3 years ago
Caihui 1e304b5826 Remove keystone v2 related code
Kyestone V2 support was removed in Train, so it's safe to do such cleanup.

Change-Id: I6a379ef79429eb218c6095397949fd8116a934c2
3 years ago
Michal Arbet a197c8caf8 Fix creation of full backup when using cindernative incremental
Per configuration freezer should firstly create full backup
automatically if there are no backups for job and config options
incremental=True, mode=cindernative are set. This patch is fixing this.

From config:
>> # When the option is set, freezer will perform a cindernative
   incremental backup instead of the default full backup. And if True,
   but volume do not have a base full backup, freezer will do a full backup
   first.
>> #incremental = <None>

Change-Id: Ib56c5528bcdedc34c16c209488c7439250dd85e1
3 years ago
zhufl 7a9bcfb907 Fix missing parameter backup_id in the log message
This is to add missing parameter backup_id in the log message.

Change-Id: I2a356379c830156c8aba32d137ebd12a3ad49b31
3 years ago
zhulingjie 63b5e271e4 Update json module to jsonutils
json is deprecated, should use oslo_serialization.jsonutils
instead.

Change-Id: Ib4b562c3f37a5c133f3a6ae8efa00a26c8b41846
4 years ago
zhufl 8d2cbeff00 Add missing ws seperator between words
This is to add missing ws seperator between words.

Change-Id: I55731b70dec4ecb19bf1f3ac2307091ba6a625ba
4 years ago
gengchc2 d59b138182 Modify a few bugs for supporting ftp/ftps
Change-Id: Ia0cd1a3561097f543cab932bf34cd8161754a0d4
5 years ago
gengchc2 93dbf58160 Add ftp support framework in freezer
The patch adds ftp support framework in freezer.

ref: https://storyboard.openstack.org/#!/story/2004332

Change-Id: I68553e1b0d98997af4bff4ce57da81b1fb835491
Story: #2004332
Task: #27917
5 years ago
Doug Hellmann 3e1e0bd7ed update pylint to 1.9.2
The older version of pylint being used does not work correctly under
python 3. In order to be able to update the pylint job to run under
python 3, we need to update the tool.

This patch updates to the latest version at this time. It also updates
and pins astroid, which was previously capped. Using a pin instead of
a cap should let us avoid issues with new releases while being
specific about which version to actually use.

The import-error linter rule is disabled because it appears in
Windows-related code that looks for modules we don't expect to be able
to find on the CI system under Linux.

The non-iterator-returned rule is disabled because it is erroring on a
class that doesn't make sense (freezer.utils.utils.ReSizeStream does
appear to honor the iterator protocol). Further investigation is
probably warranted on this one.

The public entry point for multiprocessing.SimpleQueue is the
top-level multiprocessing module, not multiprocessing.queues. The
linter correctly caught this error because the ctx argument was not
being passed to the class. The fix is to use the top-level entry point
to access the class.

basestring is no longer defined under python 3. The fix is to use
six.string_types, which correctly sets the alias to str or
basestring. By using the library, we can avoid having to tell the
linter to ignore the local customization.

The linter also caught a base raise, without an exception specified
and not in the context of an exception handler. I added an exception
using the pattern from the one on an earlier line.

Change-Id: I349de35c9ee52e2946e661f777308444b61ba4e0
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Co-Authored-By: Nguyen Hai <nguyentrihai93@gmail.com>
5 years ago
Doug Hellmann 2ee0583763 fix pep8 errors under python 3
Under python 3 'print' is a function, and the linter does not like
having a space between the function name and the paren indicating the
call. Remove the space.

The builtin 'file' is removed under python 3. Replace its use with
'open', which is available on both python 2 and 3.

Change-Id: Ib8522d8ab1974a4ba3e407ffbe449e2f5fc9471a
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
5 years ago
David Rabel 9f8d6c382e Fix license boilerplates
license boilerplates as docstring are included in automatically
generated documentation which leads to wrong formatting.

For example the indented hyperlink to the license is formatted as
quotation.

Change-Id: I9d6088ab48d6787f29b593bfa5445b6a84e99de7
5 years ago
Zuul 41a61eb9de Merge "Update uuid.uuid4() to uuidutils.generate_uuid()" 5 years ago
wangqi 65d1e87ec1 fix a typo
Change-Id: I5ade256f15d38ab2966de96f157c64400648ca74
5 years ago
caoyuan f07dca96e4 Update uuid.uuid4() to uuidutils.generate_uuid()
Since oslo.utils provide the ability to generate the uuid string,
and some others use oslo.utils[0] too. For consistency, this ps
replaces uuid.uuid4() with uuidutils.generate_uuid().

missing from Ide5cdaf48a27e9c080fd8691b100a601f82ca2bf

Change-Id: Ia9b8cda25252b70d3706c23e402ae81ccf48e33e
5 years ago
caoyuan 7da838765d Fit the indentation for log
Change-Id: Ifc29c4990285ae3f8faad0c07ece0eb475dd0818
5 years ago
Andreas Jaeger 037cf3fa81 Fix doc build warnings
Enable treading warnings as errors so that no new broken stuff gets
merged. Remove obsolete way of doing it, it's a nop.

Fix bugs found:
* Add missing sphinx modules to properly generate content.
* Misformatting of comments and files
* Do not index the windows modules, they import modules that do not
  exist on Linux.
* Place api docs in reference/api according to
  http://specs.openstack.org/openstack/docs-specs/specs/pike/os-manuals-migration.html
  and reference it. Update .gitignore for this.
* Include missing files in tree.

Change-Id: I57d3124ac9571f189cd0e10e4cf7e805b8e09045
6 years ago
Pengju Jiao b2a1b57141 Fix restore cinder volume error
When doing restore of cinder volume from specify swift
container named 'freezer/prefix', it will fail because
the wrong usage of swift client. 'freezer' should be
container name, 'prefix' should be object prefix.

Change-Id: Ib9a8092ac9afb3e3867be91501a198d1ab867efc
Closes-Bug:#1714170
6 years ago
yangyapeng 0157b2df50 Increase the fullbackup-rotation for cinder backup
Define fullbackup-rotation for cinder fullbackup,
and delete the fullbackup off limit.

Usage:
freezer-agent --action admin --mode cindernative \
--cindernative-vol-id 111 --fullbackup-rotation 2

Change-Id: Iaa529735d6c6bb5339ececc6fa49f6dc8e975d43
6 years ago
Pengju Jiao 55d6645b07 Remove redundant initialization of swift client
When using ssh, local or s3 storage, freezer do not need do the
initialization of swift client in the process of creating image.

Change-Id: I5280d3e97bed7f2c488acc2ed6bd2befe1f21b88
Closes-Bug: #1705603
6 years ago
Pengju Jiao bbe6c15924 Fix cinder mode backup fail into an infinite loop
When use cinder mode to backup cinder volume which is bigger
than 1G in devstack environment, it will fail into an infinite
loop. It is because the max_file_size in swift.conf is set to
1G by default. This will cause creating image error, and then
cause freezer-agent failure. This patch will catch the exceptions
and fix the issue.

Change-Id: Icee5656a3f187b128313a98918b9c6c9612f66c9
Closes-Bug: #1703373
6 years ago
Pengju Jiao c4d1afac07 Increase s3 driver support
When use s3 driver, you should specify storage type with
'--storage s3', specify the auth info like '--access-key xxx'
and '--secret-key xxx', and specify the S3 compatible storage
endpoint with '--endpoint  http://ip:port'.

Change-Id: If35468b3bd3a156ac5ade60c771ec8ff1a320139
Implements: blueprint s3-driver-support
6 years ago
Jenkins 7c32f4aaef Merge "Add support for backup of volume boot nova instance" 6 years ago
Pengju Jiao 95292d10ef Add support for backup of volume boot nova instance
Currently, nova backup only support image type
instance. When using 'freezer-agent --action backup
--engine nova --nova-inst-id xxx --mode nova
--no-incremental true' to backup instance that boot
from volume or snapshot, it gives us the result of
successful backup. But when we restore and launch
the instance from the backup data, it will fail
with 'no boot device error' message. This patch
add support for backup of volume boot nova
instance and will fix the issue.

Change-Id: Ibd87087c5f631fc47357395e9ed7ca23b7844a51
Closes-Bug: #1685763
6 years ago
Pengju Jiao 5cb2c7a226 Fix restore nova instance fail
Currently, restore nova feature is broken, it is because the
latest python-novaclient has removed the 'nova.network'. This
patch use python-neutronclient instead and will fix the issue.

Change-Id: Ifb2ab820a3cfc347d86a1b0b2fac79217752d227
Closes-Bug: #1693437
6 years ago
Jenkins fdf8f07810 Merge "Optimize cinder mode backup in special cases" 6 years ago
Pengju Jiao 9f0aef1266 Optimize cinder mode backup in special cases
1. The backup may be in an infinite loop in the case that
   the volume copy is in error state.
2. When snapshot error, backup will be interrupted, but
   the wrong snapshot will never be deleted.

Change-Id: Ia29ae1d352930852c80ba776f5bf44173a42cadb
Closes-Bug: #1685261
6 years ago
kwu 4a5b0880e0 Replace unintented key removal behavior using getter
Closes-bug: 1678003
Change-Id: Ife81e0c558c4bb640ffc027dabea10992c157c41
6 years ago
Saad Zaher 103b6ba352 Use Timeout option
Using CLI option timeout for different operations

   1. Nova engine
   2. Backup Operations

Change-Id: Iec86658fc09333efd9b27d0418b227938a106dcc
6 years ago
jiangpch 3c96039d7a Change some confusing log messages.
Change-Id: Ifd47ebe589dc5a39756d0773ac42bd8ae0f4f57a
6 years ago
Pierre-Arthur MATHIEU af8e1caaf6 Fix backups of nameless volumes
Change-Id: I2d1dfb45f816bd38ec2f663c3159b827c46634c9
6 years ago
Saad Zaher 7b05af4835 Fix Cinder restore
Provide alternative names to newly restored volume in case of the
previous name doesn't exists in the metadata

Change-Id: Ib5195bfcc7c087efe6abc39679ec03635c9b8913
6 years ago
Saad Zaher 6ef45bf658 Fix max_segment_size parameter
Change-Id: Ic7266d46f2f30f6d519db6acdb01d6470382243d
6 years ago
Jenkins 1a58dd23f5 Merge "Add flexible wait mechanism for events" 6 years ago
Saad Zaher bc976c1463 Fix SSL connections to connect to swift, glance, nova
Change-Id: Ida2624086ddbe412f2bfe4c3ef87c431a08eb3d9
Closes-Bug: #1664631
6 years ago
Gleb Stepanov 43d631c616 Add flexible wait mechanism for events
As far as nova is not hard-realtime system it is
we should not depend on particular sleep time waiting
for some event.

Change-Id: I4271acbefbd735bb943263d664c5d68853ade0bc
6 years ago
Jenkins 01b8f89220 Merge "Backup/restore cinder/nova to ssh" 7 years ago
Dmitry Stepanenko 29f12645b4 Backup/restore cinder/nova to ssh
This patch implements ability to backup/restore
to remote ssh host

freezer-agent --storage ssh --ssh-key <pub_key> --ssh-username <user>
--ssh-host <host> --container <path-to-remote-backup> --mode cinder
--cinder-vol-id <cinder-id>

freezer-agent --action restore --storage ssh --ssh-key <pub_key>
--ssh-username <user> --ssh-host <host> --container
<path-to-remote-backup> --mode cinder --cinder-vol-id <cinder-id>

Change-Id: If79c3473646e32bcda14a83db53fe95479fffff4
7 years ago
Jenkins 9cb00cb377 Merge "Replace LOG.warn with LOG.warning" 7 years ago
yangyapeng eee345b4c6 Backup nova/cinder to local
Freezer-agent backup volume_by_glance upload data to swift by default.
This patch backup it and metadata to local,Now.

usage:
backup nova / cinder by glance to local:
freezer-agent --cinder-vol-id 0bd0d291-e75c-4fd9-b13b-058c335a8497
--storage local --container /home/nfs --mode cinder

restore:

freezer-agent --action restore
--cinder-vol-id 0bd0d291-e75c-4fd9-b13b-058c335a8497
--storage local --container /home/nfs
--restore-from-date 2016-05-10T00:01:00

Implements blueprint: backup-nova-cinder-to-non-swift

Change-Id: I9bc8496fea7727edbf35130b7dbf9bb435d7038b
7 years ago
Dmitry Stepanenko 35adab80fd Restore by glance fail to remove temporary image
When restoring cinder by glance temporary image
is created but failed to be cleaned up because
of wrong parameters used for it's deletion.

Change-Id: Id4b37eee6c4b7b4f3c76bf43cdca5092c70493b4
Closes-Bug: #1648150
7 years ago
Jenkins 62f7ea3f56 Merge "Fix restore nova nova_network validation" 7 years ago
yangyapeng ef9397db90 Fix restore nova nova_network validation
Change-Id: I281259c598f20f7fd9b1b515c81525fbc19ff6e7
7 years ago
gecong1973 eb8d3777ad Replace LOG.warn with LOG.warning
logging.warn is deprecated in Python 3.[1]
[1] https://docs.python.org/3/library/logging.html#logging.warning

Change-Id: Ia87055a5bf51aade370e69921956aee0189304a4
7 years ago