1. Packages
  2. Packages
  3. Proxmox Virtual Environment (Proxmox VE)
  4. API Docs
  5. getFileLegacy
Viewing docs for Proxmox Virtual Environment (Proxmox VE) v8.1.0
published on Sunday, Apr 26, 2026 by Daniel Muehlbachler-Pietrzykowski
proxmoxve logo
Viewing docs for Proxmox Virtual Environment (Proxmox VE) v8.1.0
published on Sunday, Apr 26, 2026 by Daniel Muehlbachler-Pietrzykowski

    Deprecated: Use proxmoxve.getFile instead. This data source will be removed in v1.0.

    Retrieves information about an existing file in a Proxmox Virtual Environment node.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
    
    const ubuntuIso = proxmoxve.getFileLegacy({
        nodeName: "pve",
        datastoreId: "local",
        contentType: "iso",
        fileName: "ubuntu-22.04.3-live-server-amd64.iso",
    });
    const ubuntuContainerTemplate = proxmoxve.getFileLegacy({
        nodeName: "pve",
        datastoreId: "local",
        contentType: "vztmpl",
        fileName: "ubuntu-22.04-standard_22.04-1_amd64.tar.zst",
    });
    const cloudInitSnippet = proxmoxve.getFileLegacy({
        nodeName: "pve",
        datastoreId: "local",
        contentType: "snippets",
        fileName: "cloud-init-config.yaml",
    });
    const importedFile = proxmoxve.getFileLegacy({
        nodeName: "pve",
        datastoreId: "local",
        contentType: "import",
        fileName: "imported-config.yaml",
    });
    export const ubuntuIsoId = ubuntuIso.then(ubuntuIso => ubuntuIso.id);
    export const ubuntuIsoSize = ubuntuIso.then(ubuntuIso => ubuntuIso.fileSize);
    export const containerTemplateFormat = ubuntuContainerTemplate.then(ubuntuContainerTemplate => ubuntuContainerTemplate.fileFormat);
    const example = new proxmoxve.VmLegacy("example", {
        nodeName: "pve",
        vmId: 100,
        cdrom: {
            fileId: ubuntuIso.then(ubuntuIso => ubuntuIso.id),
        },
        cpu: {
            cores: 2,
        },
        memory: {
            dedicated: 2048,
        },
        disks: [{
            datastoreId: "local-lvm",
            fileFormat: "qcow2",
            size: 20,
        }],
        networkDevices: [{
            bridge: "vmbr0",
        }],
    });
    
    import pulumi
    import pulumi_proxmoxve as proxmoxve
    
    ubuntu_iso = proxmoxve.get_file_legacy(node_name="pve",
        datastore_id="local",
        content_type="iso",
        file_name="ubuntu-22.04.3-live-server-amd64.iso")
    ubuntu_container_template = proxmoxve.get_file_legacy(node_name="pve",
        datastore_id="local",
        content_type="vztmpl",
        file_name="ubuntu-22.04-standard_22.04-1_amd64.tar.zst")
    cloud_init_snippet = proxmoxve.get_file_legacy(node_name="pve",
        datastore_id="local",
        content_type="snippets",
        file_name="cloud-init-config.yaml")
    imported_file = proxmoxve.get_file_legacy(node_name="pve",
        datastore_id="local",
        content_type="import",
        file_name="imported-config.yaml")
    pulumi.export("ubuntuIsoId", ubuntu_iso.id)
    pulumi.export("ubuntuIsoSize", ubuntu_iso.file_size)
    pulumi.export("containerTemplateFormat", ubuntu_container_template.file_format)
    example = proxmoxve.VmLegacy("example",
        node_name="pve",
        vm_id=100,
        cdrom={
            "file_id": ubuntu_iso.id,
        },
        cpu={
            "cores": 2,
        },
        memory={
            "dedicated": 2048,
        },
        disks=[{
            "datastore_id": "local-lvm",
            "file_format": "qcow2",
            "size": 20,
        }],
        network_devices=[{
            "bridge": "vmbr0",
        }])
    
    package main
    
    import (
    	"github.com/muhlba91/pulumi-proxmoxve/sdk/v8/go/proxmoxve"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ubuntuIso, err := proxmoxve.GetFileLegacy(ctx, &proxmoxve.LookupFileLegacyArgs{
    			NodeName:    "pve",
    			DatastoreId: "local",
    			ContentType: "iso",
    			FileName:    "ubuntu-22.04.3-live-server-amd64.iso",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ubuntuContainerTemplate, err := proxmoxve.GetFileLegacy(ctx, &proxmoxve.LookupFileLegacyArgs{
    			NodeName:    "pve",
    			DatastoreId: "local",
    			ContentType: "vztmpl",
    			FileName:    "ubuntu-22.04-standard_22.04-1_amd64.tar.zst",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = proxmoxve.GetFileLegacy(ctx, &proxmoxve.LookupFileLegacyArgs{
    			NodeName:    "pve",
    			DatastoreId: "local",
    			ContentType: "snippets",
    			FileName:    "cloud-init-config.yaml",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = proxmoxve.GetFileLegacy(ctx, &proxmoxve.LookupFileLegacyArgs{
    			NodeName:    "pve",
    			DatastoreId: "local",
    			ContentType: "import",
    			FileName:    "imported-config.yaml",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("ubuntuIsoId", ubuntuIso.Id)
    		ctx.Export("ubuntuIsoSize", ubuntuIso.FileSize)
    		ctx.Export("containerTemplateFormat", ubuntuContainerTemplate.FileFormat)
    		_, err = proxmoxve.NewVmLegacy(ctx, "example", &proxmoxve.VmLegacyArgs{
    			NodeName: pulumi.String("pve"),
    			VmId:     pulumi.Int(100),
    			Cdrom: &proxmoxve.VmLegacyCdromArgs{
    				FileId: pulumi.String(ubuntuIso.Id),
    			},
    			Cpu: &proxmoxve.VmLegacyCpuArgs{
    				Cores: pulumi.Int(2),
    			},
    			Memory: &proxmoxve.VmLegacyMemoryArgs{
    				Dedicated: pulumi.Int(2048),
    			},
    			Disks: proxmoxve.VmLegacyDiskArray{
    				&proxmoxve.VmLegacyDiskArgs{
    					DatastoreId: pulumi.String("local-lvm"),
    					FileFormat:  pulumi.String("qcow2"),
    					Size:        pulumi.Int(20),
    				},
    			},
    			NetworkDevices: proxmoxve.VmLegacyNetworkDeviceArray{
    				&proxmoxve.VmLegacyNetworkDeviceArgs{
    					Bridge: pulumi.String("vmbr0"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using ProxmoxVE = Pulumi.ProxmoxVE;
    
    return await Deployment.RunAsync(() => 
    {
        var ubuntuIso = ProxmoxVE.Index.GetFileLegacy.Invoke(new()
        {
            NodeName = "pve",
            DatastoreId = "local",
            ContentType = "iso",
            FileName = "ubuntu-22.04.3-live-server-amd64.iso",
        });
    
        var ubuntuContainerTemplate = ProxmoxVE.Index.GetFileLegacy.Invoke(new()
        {
            NodeName = "pve",
            DatastoreId = "local",
            ContentType = "vztmpl",
            FileName = "ubuntu-22.04-standard_22.04-1_amd64.tar.zst",
        });
    
        var cloudInitSnippet = ProxmoxVE.Index.GetFileLegacy.Invoke(new()
        {
            NodeName = "pve",
            DatastoreId = "local",
            ContentType = "snippets",
            FileName = "cloud-init-config.yaml",
        });
    
        var importedFile = ProxmoxVE.Index.GetFileLegacy.Invoke(new()
        {
            NodeName = "pve",
            DatastoreId = "local",
            ContentType = "import",
            FileName = "imported-config.yaml",
        });
    
        var example = new ProxmoxVE.Index.VmLegacy("example", new()
        {
            NodeName = "pve",
            VmId = %!v(PANIC=Format method: fatal: A failure has occurred: unexpected literal type in GenLiteralValueExpression: cty.NumberIntVal(100) (example.pp:53,14-17)),
            Cdrom = new ProxmoxVE.Inputs.VmLegacyCdromArgs
            {
                FileId = ubuntuIso.Apply(getFileLegacyResult => getFileLegacyResult.Id),
            },
            Cpu = new ProxmoxVE.Inputs.VmLegacyCpuArgs
            {
                Cores = %!v(PANIC=Format method: fatal: A failure has occurred: unexpected literal type in GenLiteralValueExpression: cty.NumberIntVal(2) (example.pp:59,13-14)),
            },
            Memory = new ProxmoxVE.Inputs.VmLegacyMemoryArgs
            {
                Dedicated = %!v(PANIC=Format method: fatal: A failure has occurred: unexpected literal type in GenLiteralValueExpression: cty.NumberIntVal(2048) (example.pp:62,17-21)),
            },
            Disks = new[]
            {
                new ProxmoxVE.Inputs.VmLegacyDiskArgs
                {
                    DatastoreId = "local-lvm",
                    FileFormat = "qcow2",
                    Size = %!v(PANIC=Format method: fatal: A failure has occurred: unexpected literal type in GenLiteralValueExpression: cty.NumberIntVal(20) (example.pp:67,19-21)),
                },
            },
            NetworkDevices = new[]
            {
                new ProxmoxVE.Inputs.VmLegacyNetworkDeviceArgs
                {
                    Bridge = "vmbr0",
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["ubuntuIsoId"] = ubuntuIso.Apply(getFileLegacyResult => getFileLegacyResult.Id),
            ["ubuntuIsoSize"] = ubuntuIso.Apply(getFileLegacyResult => getFileLegacyResult.FileSize),
            ["containerTemplateFormat"] = ubuntuContainerTemplate.Apply(getFileLegacyResult => getFileLegacyResult.FileFormat),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.proxmoxve.ProxmoxveFunctions;
    import com.pulumi.proxmoxve.inputs.GetFileLegacyArgs;
    import io.muehlbachler.pulumi.proxmoxve.VmLegacy;
    import io.muehlbachler.pulumi.proxmoxve.VmLegacyArgs;
    import com.pulumi.proxmoxve.inputs.VmLegacyCdromArgs;
    import com.pulumi.proxmoxve.inputs.VmLegacyCpuArgs;
    import com.pulumi.proxmoxve.inputs.VmLegacyMemoryArgs;
    import com.pulumi.proxmoxve.inputs.VmLegacyDiskArgs;
    import com.pulumi.proxmoxve.inputs.VmLegacyNetworkDeviceArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var ubuntuIso = ProxmoxveFunctions.getFileLegacy(GetFileLegacyArgs.builder()
                .nodeName("pve")
                .datastoreId("local")
                .contentType("iso")
                .fileName("ubuntu-22.04.3-live-server-amd64.iso")
                .build());
    
            final var ubuntuContainerTemplate = ProxmoxveFunctions.getFileLegacy(GetFileLegacyArgs.builder()
                .nodeName("pve")
                .datastoreId("local")
                .contentType("vztmpl")
                .fileName("ubuntu-22.04-standard_22.04-1_amd64.tar.zst")
                .build());
    
            final var cloudInitSnippet = ProxmoxveFunctions.getFileLegacy(GetFileLegacyArgs.builder()
                .nodeName("pve")
                .datastoreId("local")
                .contentType("snippets")
                .fileName("cloud-init-config.yaml")
                .build());
    
            final var importedFile = ProxmoxveFunctions.getFileLegacy(GetFileLegacyArgs.builder()
                .nodeName("pve")
                .datastoreId("local")
                .contentType("import")
                .fileName("imported-config.yaml")
                .build());
    
            ctx.export("ubuntuIsoId", ubuntuIso.id());
            ctx.export("ubuntuIsoSize", ubuntuIso.fileSize());
            ctx.export("containerTemplateFormat", ubuntuContainerTemplate.fileFormat());
            var example = new VmLegacy("example", VmLegacyArgs.builder()
                .nodeName("pve")
                .vmId(%!v(PANIC=Format method: fatal: A failure has occurred: unexpected literal type in GenLiteralValueExpression: cty.NumberIntVal(100) (example.pp:53,14-17)))
                .cdrom(VmLegacyCdromArgs.builder()
                    .fileId(ubuntuIso.id())
                    .build())
                .cpu(VmLegacyCpuArgs.builder()
                    .cores(%!v(PANIC=Format method: fatal: A failure has occurred: unexpected literal type in GenLiteralValueExpression: cty.NumberIntVal(2) (example.pp:59,13-14)))
                    .build())
                .memory(VmLegacyMemoryArgs.builder()
                    .dedicated(%!v(PANIC=Format method: fatal: A failure has occurred: unexpected literal type in GenLiteralValueExpression: cty.NumberIntVal(2048) (example.pp:62,17-21)))
                    .build())
                .disks(VmLegacyDiskArgs.builder()
                    .datastoreId("local-lvm")
                    .fileFormat("qcow2")
                    .size(%!v(PANIC=Format method: fatal: A failure has occurred: unexpected literal type in GenLiteralValueExpression: cty.NumberIntVal(20) (example.pp:67,19-21)))
                    .build())
                .networkDevices(VmLegacyNetworkDeviceArgs.builder()
                    .bridge("vmbr0")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: proxmoxve:VmLegacy
        properties:
          nodeName: pve
          vmId: 100
          cdrom:
            fileId: ${ubuntuIso.id}
          cpu:
            cores: 2
          memory:
            dedicated: 2048
          disks:
            - datastoreId: local-lvm
              fileFormat: qcow2
              size: 20
          networkDevices:
            - bridge: vmbr0
    variables:
      ubuntuIso:
        fn::invoke:
          function: proxmoxve:getFileLegacy
          arguments:
            nodeName: pve
            datastoreId: local
            contentType: iso
            fileName: ubuntu-22.04.3-live-server-amd64.iso
      ubuntuContainerTemplate:
        fn::invoke:
          function: proxmoxve:getFileLegacy
          arguments:
            nodeName: pve
            datastoreId: local
            contentType: vztmpl
            fileName: ubuntu-22.04-standard_22.04-1_amd64.tar.zst
      cloudInitSnippet:
        fn::invoke:
          function: proxmoxve:getFileLegacy
          arguments:
            nodeName: pve
            datastoreId: local
            contentType: snippets
            fileName: cloud-init-config.yaml
      importedFile:
        fn::invoke:
          function: proxmoxve:getFileLegacy
          arguments:
            nodeName: pve
            datastoreId: local
            contentType: import
            fileName: imported-config.yaml
    outputs:
      ubuntuIsoId: ${ubuntuIso.id}
      ubuntuIsoSize: ${ubuntuIso.fileSize}
      containerTemplateFormat: ${ubuntuContainerTemplate.fileFormat}
    
    Example coming soon!
    

    Using getFileLegacy

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getFileLegacy(args: GetFileLegacyArgs, opts?: InvokeOptions): Promise<GetFileLegacyResult>
    function getFileLegacyOutput(args: GetFileLegacyOutputArgs, opts?: InvokeOptions): Output<GetFileLegacyResult>
    def get_file_legacy(content_type: Optional[str] = None,
                        datastore_id: Optional[str] = None,
                        file_name: Optional[str] = None,
                        node_name: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetFileLegacyResult
    def get_file_legacy_output(content_type: pulumi.Input[Optional[str]] = None,
                        datastore_id: pulumi.Input[Optional[str]] = None,
                        file_name: pulumi.Input[Optional[str]] = None,
                        node_name: pulumi.Input[Optional[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetFileLegacyResult]
    func LookupFileLegacy(ctx *Context, args *LookupFileLegacyArgs, opts ...InvokeOption) (*LookupFileLegacyResult, error)
    func LookupFileLegacyOutput(ctx *Context, args *LookupFileLegacyOutputArgs, opts ...InvokeOption) LookupFileLegacyResultOutput

    > Note: This function is named LookupFileLegacy in the Go SDK.

    public static class GetFileLegacy 
    {
        public static Task<GetFileLegacyResult> InvokeAsync(GetFileLegacyArgs args, InvokeOptions? opts = null)
        public static Output<GetFileLegacyResult> Invoke(GetFileLegacyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetFileLegacyResult> getFileLegacy(GetFileLegacyArgs args, InvokeOptions options)
    public static Output<GetFileLegacyResult> getFileLegacy(GetFileLegacyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: proxmoxve:index/getFileLegacy:getFileLegacy
      arguments:
        # arguments dictionary
    data "proxmoxve_getfilelegacy" "name" {
        # arguments
    }

    The following arguments are supported:

    ContentType string
    The content type of the file.
    DatastoreId string
    The identifier of the datastore.
    FileName string
    The name of the file.
    NodeName string
    The name of the node.
    ContentType string
    The content type of the file.
    DatastoreId string
    The identifier of the datastore.
    FileName string
    The name of the file.
    NodeName string
    The name of the node.
    content_type string
    The content type of the file.
    datastore_id string
    The identifier of the datastore.
    file_name string
    The name of the file.
    node_name string
    The name of the node.
    contentType String
    The content type of the file.
    datastoreId String
    The identifier of the datastore.
    fileName String
    The name of the file.
    nodeName String
    The name of the node.
    contentType string
    The content type of the file.
    datastoreId string
    The identifier of the datastore.
    fileName string
    The name of the file.
    nodeName string
    The name of the node.
    content_type str
    The content type of the file.
    datastore_id str
    The identifier of the datastore.
    file_name str
    The name of the file.
    node_name str
    The name of the node.
    contentType String
    The content type of the file.
    datastoreId String
    The identifier of the datastore.
    fileName String
    The name of the file.
    nodeName String
    The name of the node.

    getFileLegacy Result

    The following output properties are available:

    ContentType string
    The content type of the file.
    DatastoreId string
    The identifier of the datastore.
    FileFormat string
    The format of the file.
    FileName string
    The name of the file.
    FileSize int
    The size of the file in bytes.
    Id string
    The unique identifier of the file (volume ID).
    NodeName string
    The name of the node.
    Vmid int
    The VM ID associated with the file (if applicable).
    ContentType string
    The content type of the file.
    DatastoreId string
    The identifier of the datastore.
    FileFormat string
    The format of the file.
    FileName string
    The name of the file.
    FileSize int
    The size of the file in bytes.
    Id string
    The unique identifier of the file (volume ID).
    NodeName string
    The name of the node.
    Vmid int
    The VM ID associated with the file (if applicable).
    content_type string
    The content type of the file.
    datastore_id string
    The identifier of the datastore.
    file_format string
    The format of the file.
    file_name string
    The name of the file.
    file_size number
    The size of the file in bytes.
    id string
    The unique identifier of the file (volume ID).
    node_name string
    The name of the node.
    vmid number
    The VM ID associated with the file (if applicable).
    contentType String
    The content type of the file.
    datastoreId String
    The identifier of the datastore.
    fileFormat String
    The format of the file.
    fileName String
    The name of the file.
    fileSize Integer
    The size of the file in bytes.
    id String
    The unique identifier of the file (volume ID).
    nodeName String
    The name of the node.
    vmid Integer
    The VM ID associated with the file (if applicable).
    contentType string
    The content type of the file.
    datastoreId string
    The identifier of the datastore.
    fileFormat string
    The format of the file.
    fileName string
    The name of the file.
    fileSize number
    The size of the file in bytes.
    id string
    The unique identifier of the file (volume ID).
    nodeName string
    The name of the node.
    vmid number
    The VM ID associated with the file (if applicable).
    content_type str
    The content type of the file.
    datastore_id str
    The identifier of the datastore.
    file_format str
    The format of the file.
    file_name str
    The name of the file.
    file_size int
    The size of the file in bytes.
    id str
    The unique identifier of the file (volume ID).
    node_name str
    The name of the node.
    vmid int
    The VM ID associated with the file (if applicable).
    contentType String
    The content type of the file.
    datastoreId String
    The identifier of the datastore.
    fileFormat String
    The format of the file.
    fileName String
    The name of the file.
    fileSize Number
    The size of the file in bytes.
    id String
    The unique identifier of the file (volume ID).
    nodeName String
    The name of the node.
    vmid Number
    The VM ID associated with the file (if applicable).

    Package Details

    Repository
    proxmoxve muhlba91/pulumi-proxmoxve
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the proxmox Terraform Provider.
    proxmoxve logo
    Viewing docs for Proxmox Virtual Environment (Proxmox VE) v8.1.0
    published on Sunday, Apr 26, 2026 by Daniel Muehlbachler-Pietrzykowski
      Try Pulumi Cloud free. Your team will thank you.