lib/puppet/provider/vc_vm/default.rb
def add_nfs_datastore
    vm_host = find_vm_host
    hds = vm_host.configManager.datastoreSystem
    nfsdatastoreconfig = {:remoteHost => get_host_management_ip,
                          :remotePath => resource[:nfs]["remote_path"],
                          :localPath =>  "_nfs_asm_#{vm.name}",
                          :accessMode => "readOnly"
    }

    nfsds = get_nfs_datastore(hds)
    #checks if nfsdatastore already exists
    if nfsds
      Puppet.notice ("nfs is already mounted as %s" % nfsds.info.name )
    else
      nfsds = hds.CreateNasDatastore(:spec => VIM.HostNasVolumeSpec(nfsdatastoreconfig))
      Puppet.notice ("added nfs datastore %s and mounted" % nfsds.info.name )
    end

    nfsds
  end
# Adds nfs_datastore on the host of the vm
# checks for existing nfs_datastores if exist
Adds nfs_datastore on the host of the vm
checks for existing nfs_datastores if exist
Adds nfs_datastore on the host of the vm checks for existing nfs_datastores if exist
def add_nfs_datastore
    vm_host = find_vm_host
    hds = vm_host.configManager.datastoreSystem
    nfsdatastoreconfig = {:remoteHost => get_host_management_ip,
                          :remotePath => resource[:nfs]["remote_path"],
                          :localPath =>  "_nfs_asm_#{vm.name}",
                          :accessMode => "readOnly"
    }
    nfsds = get_nfs_datastore(hds)
    if nfsds
      Puppet.notice ("nfs is already mounted as %s" % nfsds.info.name )
    else
      nfsds = hds.CreateNasDatastore(:spec => VIM.HostNasVolumeSpec(nfsdatastoreconfig))
      Puppet.notice ("added nfs datastore %s and mounted" % nfsds.info.name )
    end
    nfsds
  end
def add_nfs_datastore vm_host = find_vm_host hds = vm_host . configManager . datastoreSystem nfsdatastoreconfig = { :remoteHost => get_host_management_ip , :remotePath => resource [ :nfs ] [ "remote_path" ] , :localPath => "_nfs_asm_#{vm.name}" , :accessMode => "readOnly" } nfsds = get_nfs_datastore ( hds ) if nfsds Puppet . notice ( "nfs is already mounted as %s" % nfsds . info . name ) else nfsds = hds . CreateNasDatastore ( :spec => VIM . HostNasVolumeSpec ( nfsdatastoreconfig ) ) Puppet . notice ( "added nfs datastore %s and mounted" % nfsds . info . name ) end nfsds end
Adds nfs_datastore on the host of the vm
checks for existing nfs_datastores if exist
Adds nfs_datastore on the host of the vm checks for existing nfs_datastores if exist
#checks if nfsdatastore already exists