Skip to content

inactive storage volume request fails #118

@conncampbell

Description

@conncampbell

Describe the bug
When a storage device is available only on one node [Node2], the following error is returned.
"HTTP/1.1 500 storage '[storage]' is not available on node '[node1]'\r\n"

To Reproduce
Steps to reproduce the behavior:

  1. create a storage device locally on one node
  2. ensure the storage is listed in the cluster, but with only one node selected.
  3. create a storage object under the node without access to the storage
  4. the storage object will attempt to initialize the volumes, but fails with an error.

Expected behavior
no volumes should be returned on storage objects on nodes that are not active.

Desktop (please complete the following information):

  • OS: Rocky 9
  • Version 0.15.2

Additional context
Update the server.rb initialize method to skip volume init when not enabled.
def initialize(new_attributes = {})
prepare_service_value(new_attributes)
Fog::Proxmox::Attributes.set_attr_and_sym('node_id', attributes, new_attributes)
Fog::Proxmox::Attributes.set_attr_and_sym('storage', attributes, new_attributes)
requires :node_id, :storage
if enabled
initialize_volumes
end
super(new_attributes)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions