-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NetApp allows multiple virtual filer to run on one physical filer. Every API command runs under a specific vfiler context. Managing a vfiler while connecting to the actual physical filer has the benefit that you do not have to have network access to your vfiler (e.g. you can place a vfiler in a DMZ network while your physical filer is only accessable through your internal network). The NetApp Server class already implements a method `set_vfiler` that changes the context for all following api calls. Allow passing a vfiler via the connection url. So instead of using [filer.example.com] type netapp url https://user:[email protected] we accept the connection url `https://user:[email protected]/[virtalfiler]`
- Loading branch information
Showing
3 changed files
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,15 @@ Example configuration `/etc/puppet/device/pfiler01.example.com.conf`: | |
type netapp | ||
url https://root:[email protected] | ||
|
||
You can also specify a virtual filer you want to operate on: Simply | ||
provide the connection information for your physical filer and specify | ||
an optional path that represents the name of your virtual filer. Example | ||
configuration `/etc/puppet/device/vfiler01.example.com.conf`: | ||
|
||
[vfiler01.example.com] | ||
type netapp | ||
url https://root:[email protected]/vfiler01 | ||
|
||
### NetApp operations | ||
As part of this module, there is a defined type called 'netapp::vqe', which can be used to create a volume, add a qtree and create an NFS export. | ||
An example of this is: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 +10,6 @@ | |
YAML.load_file(my_fixture('system-get-version.yml')) | ||
end | ||
|
||
let :mock_device do | ||
mock 'server object', | ||
:set_admin_user => nil, | ||
:set_transport_type => nil, | ||
:set_port =>nil, | ||
:invoke => version | ||
end | ||
|
||
|
||
|
||
describe "when connecting to a new device" do | ||
it "should reject a single hostname" do | ||
expect { described_class.new('pfiler.example.com') }.to raise_error ArgumentError, /Invalid scheme/ | ||
|
@@ -49,5 +39,20 @@ | |
|
||
described_class.new('https://root:[email protected]') | ||
end | ||
|
||
it "should support vfiler" do | ||
transport = mock 'netapp server' | ||
NaServer.expects(:new).with('pfiler.example.com', 1, 13).returns transport | ||
Puppet.expects(:debug).with regexp_matches %r{connecting to Netapp device https://root:\*\*\*\*@pfiler\.example\.com} | ||
Puppet.expects(:debug).with regexp_matches /^Puppet::Device::Netapp: Version = / | ||
Puppet.expects(:debug).with 'Puppet::Device::Netapp: vfiler context has been set to VFILER01' | ||
transport.expects(:set_admin_user).with('root', 'secret') | ||
transport.expects(:set_transport_type).with('HTTPS') | ||
transport.expects(:set_port).with(443) | ||
transport.expects(:set_vfiler).with('VFILER01') | ||
transport.expects(:invoke).with('system-get-version').returns version | ||
|
||
described_class.new('https://root:[email protected]/VFILER01/reserved_for_later_usage') | ||
end | ||
end | ||
end |