{"action":"closed","issue":{"url":"https://api.github.com/repos/epost-dev/opennebula-puppet-module/issues/193","labels_url":"https://api.github.com/repos/epost-dev/opennebula-puppet-module/issues/193/labels{/name}","comments_url":"https://api.github.com/repos/epost-dev/opennebula-puppet-module/issues/193/comments","events_url":"https://api.github.com/repos/epost-dev/opennebula-puppet-module/issues/193/events","html_url":"https://github.com/epost-dev/opennebula-puppet-module/issues/193","id":105464561,"number":193,"title":"onedatastore resource type ignores basepath parameter; breaks idempotence","user":{"login":"mattthias","id":966147,"avatar_url":"https://avatars.githubusercontent.com/u/966147?v=3","gravatar_id":"","url":"https://api.github.com/users/mattthias","html_url":"https://github.com/mattthias","followers_url":"https://api.github.com/users/mattthias/followers","following_url":"https://api.github.com/users/mattthias/following{/other_user}","gists_url":"https://api.github.com/users/mattthias/gists{/gist_id}","starred_url":"https://api.github.com/users/mattthias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattthias/subscriptions","organizations_url":"https://api.github.com/users/mattthias/orgs","repos_url":"https://api.github.com/users/mattthias/repos","events_url":"https://api.github.com/users/mattthias/events{/privacy}","received_events_url":"https://api.github.com/users/mattthias/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-08T20:40:08Z","updated_at":"2015-09-09T11:18:50Z","closed_at":"2015-09-09T11:18:50Z","body":"The onedatastore resource type ignores the basepath parameter when creating the datastore. The datastore will be created with a default path. When running puppet a second time puppet tries to change the basepath which fails as the provider doesn't support that action.\r\n\r\nHow to reproduce: \r\n- Install centos6 machine\r\n- install puppet 3.7.2 \r\n- clone the opennebula-puppet-module and the puppetlabs-stdlib repo to a directory called \"modules\"\r\n```bash\r\n[root@centos6 ~]# mkdir modules\r\n[root@centos6 ~]# git clone https://github.com/epost-dev/opennebula-puppet-module.git  modules/one\r\n....\r\n[root@centos6 ~]# git clone https://github.com/puppetlabs/puppetlabs-stdlib.git modules/stdlib\r\n....\r\n```\r\n- create a simple site.pp\r\n```puppet\r\nnode 'default' {\r\n\r\n  class { one: \r\n    oned => true,\r\n  }\r\n  \r\n  onedatastore { 'beispiel':\r\n    ensure   => present,\r\n    type     => 'IMAGE_DS',\r\n    dm       => 'fs',\r\n    tm       => 'ssh',\r\n    basepath => '/srv/beispiel',\r\n  }\r\n}\r\n```\r\n- run puppet apply for the first time  (should work)\r\n```bash\r\n[root@centos6 ~]# puppet apply --modulepath=modules site.pp\r\n...\r\n\r\n```\r\n\r\n- check if the datastore exists; check the path in the xml output. As we can see there is no basepath \"srv/beispiel\".\r\n```bash\r\n[root@centos6 ~]# onedatastore list \r\n  ID NAME                SIZE AVAIL CLUSTER      IMAGES TYPE DS      TM      STAT\r\n   0 system                0M -     -                 0 sys  -       shared  on  \r\n   1 default            29.4G 89%   -                 0 img  fs      shared  on  \r\n   2 files              29.4G 89%   -                 0 fil  fs      ssh     on  \r\n 100 beispiel           29.4G 89%   -                 0 img  fs      ssh     on  \r\n[root@centos6 ~]# onedatastore list  -x | grep BASE\r\n    <BASE_PATH><![CDATA[/var/lib/one//datastores/0]]></BASE_PATH>\r\n      <BASE_PATH><![CDATA[/var/lib/one//datastores/]]></BASE_PATH>\r\n    <BASE_PATH><![CDATA[/var/lib/one//datastores/1]]></BASE_PATH>\r\n      <BASE_PATH><![CDATA[/var/lib/one//datastores/]]></BASE_PATH>\r\n    <BASE_PATH><![CDATA[/var/lib/one//datastores/2]]></BASE_PATH>\r\n      <BASE_PATH><![CDATA[/var/lib/one//datastores/]]></BASE_PATH>\r\n    <BASE_PATH><![CDATA[/var/lib/one//datastores/100]]></BASE_PATH>\r\n      <BASE_PATH><![CDATA[/var/lib/one//datastores/]]></BASE_PATH>\r\n[root@centos6 ~]# \r\n```\r\n\r\n- run puppet apply again (will surely break)\r\n```bash\r\n[root@centos6 ~]# puppet apply --modulepath=modules/ site.pp \r\nNotice: Compiled catalog for centos6 in environment production in 2.73 seconds\r\nError: Can not modify basepath. You need to delete and recreate the datastore\r\nError: /Stage[main]/Main/Node[default]/Onedatastore[beispiel]/basepath: change from /var/lib/one//datastores/ to /srv/beispiel failed: Can not modify basepath. You need to delete and recreate the datastore\r\nNotice: Finished catalog run in 5.95 seconds\r\n[root@centos6 ~]# \r\n```\r\n"}}