Fuel snapshot cli command always download snapshot to current directory, even if --dir specified

Bug #1444343 reported by Alexander Bozhenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Vitalii Kulanov
7.0.x
Won't Fix
Medium
Fuel Python (Deprecated)
Mitaka
Won't Fix
Medium
Vitalii Kulanov
Newton
Fix Committed
Medium
Vitalii Kulanov

Bug Description

In fuel cli we have two options:

To download diagnostic snapshot to current directory:
fuel snapshot
To download diagnostic snapshot to specific directory:
fuel snapshot --dir path/to/directory

And there is no option to not download it, just trigger creation via cli.
It can be pain for multigigabytes snapshot(simply not enough space on the disk to store two copies). User may want to get copy from /var/www/nailgun/dump/ only, and not create a second copy at all.

I propose to change this code:
https://github.com/stackforge/python-fuelclient/blob/master/fuelclient/cli/actions/snapshot.py#L64
To download only when --dir parameter is specified, and not download to current dir when executing via:
fuel snapshot

Changed in fuel:
assignee: nobody → Fuel Python Team (fuel-python)
milestone: none → 6.1
Changed in fuel:
status: New → Triaged
importance: Undecided → Medium
tags: added: module-client
Revision history for this message
Dmitry Pyzhov (dpyzhov) wrote :

Sorry, we have soft code freeze in action in 6.1. Moving this request to 7.0. Maybe we will have time to fix it in 6.1 timeframe.

tags: added: feature
Changed in fuel:
milestone: 6.1 → 7.0
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Alexander Bozhenko (alexbozhenko)
Changed in fuel:
assignee: Alexander Bozhenko (alexbozhenko) → Fuel QA Team (fuel-qa)
Revision history for this message
Nastya Urlapova (aurlapova) wrote :

Sergey, this issue related to fuel-client. sorry bu fuel-qa isn't responsible for it.

Changed in fuel:
assignee: Fuel QA Team (fuel-qa) → Fuel Python Team (fuel-python)
status: Triaged → Won't Fix
summary: - Fuel snapshot cli command doesn't allow not to download snapshot to
- current directory
+ Fuel snapshot cli command doesn't allow to download snapshot to current
+ directory
summary: - Fuel snapshot cli command doesn't allow to download snapshot to current
- directory
+ Fuel snapshot cli command always download snapshot to current directory,
+ even if --dir specified
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
milestone: 7.0 → 8.0
status: Won't Fix → Triaged
no longer affects: fuel/8.0.x
Dmitry Pyzhov (dpyzhov)
tags: added: area-python
Changed in fuel:
milestone: 8.0 → 9.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-fuelclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/296790

Changed in fuel:
assignee: Fuel Python Team (fuel-python) → vkulanov (vitaliy-t)
status: Triaged → In Progress
Revision history for this message
Vitalii Kulanov (vitaliy-t) wrote :

A few comments to proposed bug/feature fix, that can be discussed.

1. The first thing that the core logic doesn't make 'great' difference between these two commands

     'fuel snapshot'

     'fuel snapshot --dir /some/path'

In the first case a default directory value ('.') is used:
https://github.com/openstack/python-fuelclient/blob/master/fuelclient/cli/arguments.py#L394 I.e. first command is just equivalent to second one with the following params 'fuel snapshot --dir .' So it's hard to recognize them. That's why we can't use 'fuel snapshot' cli just for creating snapshot and not downloading. Of course we can change core logic, but I'm not sure that we should modify it and make any changes to get_dir_arg method (see link above) as it is used by the rest of cli commands. So I've added some additional option: '--download'. Now we can use this flag if we want to download snapshot after its creation.
2. Now we have the following command format:

        """To create diagnostic snapshot:
                fuel snapshot

            To create and download diagnostic snapshot to specific directory:
                fuel snapshot --download --dir path/to/directory

            To create and download diagnostic snapshot to current directory:
                fuel snapshot --download
         """

Revision history for this message
Alexander Bozhenko (alexbozhenko) wrote :

Vitaly, I think it is very cool and exactly what needed!

If possible, please add to help of
fuel snapshot
command that default location of the dump is /var/www/nailgun/dump/

Revision history for this message
Vitalii Kulanov (vitaliy-t) wrote :

@Alexandr, after some time on thinking on this problem I found that proposed in bug fix command can, possible, break user experience. How do you think? So, my another propositon is to create more 'natural' (from a user perspective) command, that will not modify existing one, but add additional feature flag '--nodownload'.

For example, a new (more 'natural') command instead previous one can be implemented like as follows:

     fuel snapshot --nodownload

Revision history for this message
Alexander Bozhenko (alexbozhenko) wrote :

I like proposal from comment #4 more. It is more obvious interface, imho.
 Yes, command will be changed, but we in support have a script with with instructions on how to generate snapshot. So we still will be able to request snapshot using fuel snapshot for both, old and new versions. But for new versions file jsut will be stored in /var/www/nailgiun/dump

Right now output is the following:
[root@fuel remote]# fuel snapshot
Generating dump...
Downloading: http://10.20.15.2:8000/api/dump/fuel-snapshot-2016-03-24_07-37-27.tar.xz Bytes: 99102756
[==============================================================================]()

If default behaviour of of 'fuel snapshot' will be not to download, can we make output like this:
[root@fuel remote]# fuel snapshot
Generating dump...
Dump is stored at /var/www/nailgun/dump on fuel master node

So it will be self-explanatory.

Revision history for this message
Vitalii Kulanov (vitaliy-t) wrote :

Ok. I will add extra information to the 'fuel snapshot' command:

     Dump is stored at /var/dump on fuel master node

BTW, as far as I understand, now dump is stored in '/var/dump' directory
(https://github.com/openstack/fuel-web/commit/c9c86d60303e669d79aef84972fe4ccecac94bd9)
Also the result of 'fuel snapshot --conf > dump_conf.yaml' looks like as follows: http://paste.openstack.org/show/491675/ (see target: /var/dump/fuel-snapshot). Means that we have to get target dump file path from config (shoud not be 'hard coded'), because if someone specify non-default config or the target path will be changed in future then the output result will be wrong.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-fuelclient (master)

Reviewed: https://review.openstack.org/296790
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=9506f4c564f3b469078498de72b6692e4d5ca597
Submitter: Jenkins
Branch: master

commit 9506f4c564f3b469078498de72b6692e4d5ca597
Author: tivaliy <email address hidden>
Date: Wed Mar 23 22:30:30 2016 +0200

    Remove download stage from 'fuel snapshot' cli

    Remove download functionality from fuel snapshot
    generation process and provide users an URL

    DocImpact
    Change-Id: I02a059aeda9094c3ebd074a717d35770b8665dfb
    Closes-Bug: 1444343

Changed in fuel:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.