madynes / kadeploy

Kadeploy is a scalable, efficient and reliable deployment system (cluster provisioning solution) for cluster and grid computing
Other
4 stars 4 forks source link

Deploying on a different hard disk requires to specify the partition number #3

Open petitalb opened 7 years ago

petitalb commented 7 years ago

Hi,

Kadeploy lets the possibility to modify the hard disk on which it will deploys the environment (option "-b"). For instance, to deploy on /dev/sda instead of /dev/sdb (the default one, on my clusters), I execute kadeploy3 -m erods-ds-1 -e jessie-x64-nfs -b sda -k.

Such a command returns the following error:

Deployment #D-837a5766-6fe4-4faa-9c30-d0e947ed663c started
[Internal Server Error]
---- NameError ----
uninitialized constant Kadeploy::APIError::INVALID
---- Stack trace ----
/usr/lib/ruby/vendor_ruby/kadeploy3/server/workflow.rb:508:in `check_config'
/usr/lib/ruby/vendor_ruby/kadeploy3/server/workflow.rb:144:in `load_config'
/usr/lib/ruby/vendor_ruby/kadeploy3/server/automata.rb:165:in `initialize'
/usr/lib/ruby/vendor_ruby/kadeploy3/server/workflow.rb:16:in `initialize'
/usr/lib/ruby/vendor_ruby/kadeploy3/server/kaworkflow.rb:376:in `new'
/usr/lib/ruby/vendor_ruby/kadeploy3/server/kaworkflow.rb:376:in `block (3 levels) in work_create'
/usr/lib/ruby/vendor_ruby/kadeploy3/server/kaworkflow.rb:345:in `each_pair'
/usr/lib/ruby/vendor_ruby/kadeploy3/server/kaworkflow.rb:345:in `block (2 levels) in work_create'
/usr/lib/ruby/vendor_ruby/kadeploy3/server/kaworkflow.rb:335:in `synchronize'
/usr/lib/ruby/vendor_ruby/kadeploy3/server/kaworkflow.rb:335:in `block in work_create'
---------------------

First it seems that the error is not correctly managed by Kadeploy. Besides, if we look closer on the source code (/usr/lib/ruby/vendor_ruby/kadeploy3/server/workflow.rb):

# Deploy on block device
if cexec.block_device and !cexec.block_device.empty? \
    and (!cexec.deploy_part or cexec.deploy_part.empty?)

    # Without a dd image
    unless cexec.environment.image[:kind] == ‘dd'
        error(APIError::INVALID,"You can only deploy directly on block device when using a dd image”)
    end

[…]

end

We can see that the if condition requires the use of the option "-p" together with the option "-b". Such a constraint is mentioned neither on the documentation, nor on the man page, nor on the error returned by Kadeploy. Besides, I do not understand such a constraint as I may want to modify the hard disk without modifying the partitioning.

Best regards, Albin PETIT