Manages OCI images pulled from OCI registries using PVE oci-registry-pull API. Pulls OCI container images and stores them as tar files in Proxmox VE datastores.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
const ubuntuLatest = new proxmoxve.oci.Image("ubuntu_latest", {
nodeName: "pve",
datastoreId: "local",
reference: "docker.io/library/ubuntu:latest",
});
const nginx = new proxmoxve.oci.Image("nginx", {
nodeName: "pve",
datastoreId: "local",
reference: "docker.io/library/nginx:alpine",
fileName: "custom_image_name.tar",
});
const debian = new proxmoxve.oci.Image("debian", {
nodeName: "pve",
datastoreId: "local",
reference: "docker.io/library/debian:bookworm",
uploadTimeout: 900,
overwrite: false,
overwriteUnmanaged: true,
});
import pulumi
import pulumi_proxmoxve as proxmoxve
ubuntu_latest = proxmoxve.oci.Image("ubuntu_latest",
node_name="pve",
datastore_id="local",
reference="docker.io/library/ubuntu:latest")
nginx = proxmoxve.oci.Image("nginx",
node_name="pve",
datastore_id="local",
reference="docker.io/library/nginx:alpine",
file_name="custom_image_name.tar")
debian = proxmoxve.oci.Image("debian",
node_name="pve",
datastore_id="local",
reference="docker.io/library/debian:bookworm",
upload_timeout=900,
overwrite=False,
overwrite_unmanaged=True)
package main
import (
"github.com/muhlba91/pulumi-proxmoxve/sdk/v7/go/proxmoxve/oci"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := oci.NewImage(ctx, "ubuntu_latest", &oci.ImageArgs{
NodeName: pulumi.String("pve"),
DatastoreId: pulumi.String("local"),
Reference: pulumi.String("docker.io/library/ubuntu:latest"),
})
if err != nil {
return err
}
_, err = oci.NewImage(ctx, "nginx", &oci.ImageArgs{
NodeName: pulumi.String("pve"),
DatastoreId: pulumi.String("local"),
Reference: pulumi.String("docker.io/library/nginx:alpine"),
FileName: pulumi.String("custom_image_name.tar"),
})
if err != nil {
return err
}
_, err = oci.NewImage(ctx, "debian", &oci.ImageArgs{
NodeName: pulumi.String("pve"),
DatastoreId: pulumi.String("local"),
Reference: pulumi.String("docker.io/library/debian:bookworm"),
UploadTimeout: pulumi.Int(900),
Overwrite: pulumi.Bool(false),
OverwriteUnmanaged: pulumi.Bool(true),
})
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 ubuntuLatest = new ProxmoxVE.Oci.Image("ubuntu_latest", new()
{
NodeName = "pve",
DatastoreId = "local",
Reference = "docker.io/library/ubuntu:latest",
});
var nginx = new ProxmoxVE.Oci.Image("nginx", new()
{
NodeName = "pve",
DatastoreId = "local",
Reference = "docker.io/library/nginx:alpine",
FileName = "custom_image_name.tar",
});
var debian = new ProxmoxVE.Oci.Image("debian", new()
{
NodeName = "pve",
DatastoreId = "local",
Reference = "docker.io/library/debian:bookworm",
UploadTimeout = 900,
Overwrite = false,
OverwriteUnmanaged = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import io.muehlbachler.pulumi.proxmoxve.Oci.Image;
import io.muehlbachler.pulumi.proxmoxve.Oci.ImageArgs;
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) {
var ubuntuLatest = new Image("ubuntuLatest", ImageArgs.builder()
.nodeName("pve")
.datastoreId("local")
.reference("docker.io/library/ubuntu:latest")
.build());
var nginx = new Image("nginx", ImageArgs.builder()
.nodeName("pve")
.datastoreId("local")
.reference("docker.io/library/nginx:alpine")
.fileName("custom_image_name.tar")
.build());
var debian = new Image("debian", ImageArgs.builder()
.nodeName("pve")
.datastoreId("local")
.reference("docker.io/library/debian:bookworm")
.uploadTimeout(900)
.overwrite(false)
.overwriteUnmanaged(true)
.build());
}
}
resources:
ubuntuLatest:
type: proxmoxve:Oci:Image
name: ubuntu_latest
properties:
nodeName: pve
datastoreId: local
reference: docker.io/library/ubuntu:latest
nginx:
type: proxmoxve:Oci:Image
properties:
nodeName: pve
datastoreId: local
reference: docker.io/library/nginx:alpine
fileName: custom_image_name.tar
debian:
type: proxmoxve:Oci:Image
properties:
nodeName: pve
datastoreId: local
reference: docker.io/library/debian:bookworm
uploadTimeout: 900
overwrite: false
overwriteUnmanaged: true
Create Image Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Image(name: string, args: ImageArgs, opts?: CustomResourceOptions);@overload
def Image(resource_name: str,
args: ImageArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Image(resource_name: str,
opts: Optional[ResourceOptions] = None,
datastore_id: Optional[str] = None,
node_name: Optional[str] = None,
reference: Optional[str] = None,
file_name: Optional[str] = None,
overwrite: Optional[bool] = None,
overwrite_unmanaged: Optional[bool] = None,
upload_timeout: Optional[int] = None)func NewImage(ctx *Context, name string, args ImageArgs, opts ...ResourceOption) (*Image, error)public Image(string name, ImageArgs args, CustomResourceOptions? opts = null)type: proxmoxve:Oci:Image
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ImageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ImageArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ImageArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ImageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ImageArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var imageResource = new ProxmoxVE.Oci.Image("imageResource", new()
{
DatastoreId = "string",
NodeName = "string",
Reference = "string",
FileName = "string",
Overwrite = false,
OverwriteUnmanaged = false,
UploadTimeout = 0,
});
example, err := oci.NewImage(ctx, "imageResource", &oci.ImageArgs{
DatastoreId: pulumi.String("string"),
NodeName: pulumi.String("string"),
Reference: pulumi.String("string"),
FileName: pulumi.String("string"),
Overwrite: pulumi.Bool(false),
OverwriteUnmanaged: pulumi.Bool(false),
UploadTimeout: pulumi.Int(0),
})
var imageResource = new Image("imageResource", ImageArgs.builder()
.datastoreId("string")
.nodeName("string")
.reference("string")
.fileName("string")
.overwrite(false)
.overwriteUnmanaged(false)
.uploadTimeout(0)
.build());
image_resource = proxmoxve.oci.Image("imageResource",
datastore_id="string",
node_name="string",
reference="string",
file_name="string",
overwrite=False,
overwrite_unmanaged=False,
upload_timeout=0)
const imageResource = new proxmoxve.oci.Image("imageResource", {
datastoreId: "string",
nodeName: "string",
reference: "string",
fileName: "string",
overwrite: false,
overwriteUnmanaged: false,
uploadTimeout: 0,
});
type: proxmoxve:Oci:Image
properties:
datastoreId: string
fileName: string
nodeName: string
overwrite: false
overwriteUnmanaged: false
reference: string
uploadTimeout: 0
Image Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Image resource accepts the following input properties:
- Datastore
Id string - The identifier for the target datastore.
- Node
Name string - The node name.
- Reference string
- The reference to the OCI image.
- File
Name string - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- Overwrite bool
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - Overwrite
Unmanaged bool - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - Upload
Timeout int - The OCI image pull timeout in seconds. Default is 600 (10min).
- Datastore
Id string - The identifier for the target datastore.
- Node
Name string - The node name.
- Reference string
- The reference to the OCI image.
- File
Name string - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- Overwrite bool
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - Overwrite
Unmanaged bool - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - Upload
Timeout int - The OCI image pull timeout in seconds. Default is 600 (10min).
- datastore
Id String - The identifier for the target datastore.
- node
Name String - The node name.
- reference String
- The reference to the OCI image.
- file
Name String - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- overwrite Boolean
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - overwrite
Unmanaged Boolean - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - upload
Timeout Integer - The OCI image pull timeout in seconds. Default is 600 (10min).
- datastore
Id string - The identifier for the target datastore.
- node
Name string - The node name.
- reference string
- The reference to the OCI image.
- file
Name string - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- overwrite boolean
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - overwrite
Unmanaged boolean - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - upload
Timeout number - The OCI image pull timeout in seconds. Default is 600 (10min).
- datastore_
id str - The identifier for the target datastore.
- node_
name str - The node name.
- reference str
- The reference to the OCI image.
- file_
name str - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- overwrite bool
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - overwrite_
unmanaged bool - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - upload_
timeout int - The OCI image pull timeout in seconds. Default is 600 (10min).
- datastore
Id String - The identifier for the target datastore.
- node
Name String - The node name.
- reference String
- The reference to the OCI image.
- file
Name String - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- overwrite Boolean
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - overwrite
Unmanaged Boolean - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - upload
Timeout Number - The OCI image pull timeout in seconds. Default is 600 (10min).
Outputs
All input properties are implicitly available as output properties. Additionally, the Image resource produces the following output properties:
Look up Existing Image Resource
Get an existing Image resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ImageState, opts?: CustomResourceOptions): Image@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
datastore_id: Optional[str] = None,
file_name: Optional[str] = None,
node_name: Optional[str] = None,
overwrite: Optional[bool] = None,
overwrite_unmanaged: Optional[bool] = None,
reference: Optional[str] = None,
size: Optional[int] = None,
upload_timeout: Optional[int] = None) -> Imagefunc GetImage(ctx *Context, name string, id IDInput, state *ImageState, opts ...ResourceOption) (*Image, error)public static Image Get(string name, Input<string> id, ImageState? state, CustomResourceOptions? opts = null)public static Image get(String name, Output<String> id, ImageState state, CustomResourceOptions options)resources: _: type: proxmoxve:Oci:Image get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Datastore
Id string - The identifier for the target datastore.
- File
Name string - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- Node
Name string - The node name.
- Overwrite bool
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - Overwrite
Unmanaged bool - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - Reference string
- The reference to the OCI image.
- Size int
- The image size in PVE.
- Upload
Timeout int - The OCI image pull timeout in seconds. Default is 600 (10min).
- Datastore
Id string - The identifier for the target datastore.
- File
Name string - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- Node
Name string - The node name.
- Overwrite bool
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - Overwrite
Unmanaged bool - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - Reference string
- The reference to the OCI image.
- Size int
- The image size in PVE.
- Upload
Timeout int - The OCI image pull timeout in seconds. Default is 600 (10min).
- datastore
Id String - The identifier for the target datastore.
- file
Name String - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- node
Name String - The node name.
- overwrite Boolean
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - overwrite
Unmanaged Boolean - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - reference String
- The reference to the OCI image.
- size Integer
- The image size in PVE.
- upload
Timeout Integer - The OCI image pull timeout in seconds. Default is 600 (10min).
- datastore
Id string - The identifier for the target datastore.
- file
Name string - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- node
Name string - The node name.
- overwrite boolean
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - overwrite
Unmanaged boolean - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - reference string
- The reference to the OCI image.
- size number
- The image size in PVE.
- upload
Timeout number - The OCI image pull timeout in seconds. Default is 600 (10min).
- datastore_
id str - The identifier for the target datastore.
- file_
name str - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- node_
name str - The node name.
- overwrite bool
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - overwrite_
unmanaged bool - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - reference str
- The reference to the OCI image.
- size int
- The image size in PVE.
- upload_
timeout int - The OCI image pull timeout in seconds. Default is 600 (10min).
- datastore
Id String - The identifier for the target datastore.
- file
Name String - The file name for the pulled OCI image. If not provided, it will be generated automatically. The file will be stored as a .tar file.
- node
Name String - The node name.
- overwrite Boolean
- By default
true. Iftrueand the OCI image size has changed in the datastore, it will be replaced. Iffalse, there will be no check. - overwrite
Unmanaged Boolean - If
trueand an OCI image with the same name already exists in the datastore, it will be deleted and the new image will be pulled. Iffalseand the image already exists, an error will be returned. - reference String
- The reference to the OCI image.
- size Number
- The image size in PVE.
- upload
Timeout Number - The OCI image pull timeout in seconds. Default is 600 (10min).
Package Details
- Repository
- proxmoxve muhlba91/pulumi-proxmoxve
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
proxmoxTerraform Provider.
