Skip to content

Commit

Permalink
Update docs and ordering for usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
thushan committed Apr 1, 2024
1 parent 9109b4d commit f3f586b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions default.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ CT_ONBOOT=0
CT_ARCH=amd64
CT_OSTYPE=debian
# NOTE: Requires an empty new line at the end

2 changes: 1 addition & 1 deletion proxmox-vm-to-ct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ function main() {

function usage() {
banner 0
echo "Usage: ${CYellow}$0${ENDMARKER} ${CBlue}--source${ENDMARKER} <hostname> ${CBlue}--target${ENDMARKER} <name> ${CBlue}--storage${ENDMARKER} <name> [options]"
echo "Usage: ${CYellow}$0${ENDMARKER} ${CBlue}--storage${ENDMARKER} <name> ${CBlue}--source${ENDMARKER} <hostname|file> ${CBlue}--target${ENDMARKER} <name> [options]"
echo "Options:"
echo " ${CCyan}--storage${ENDMARKER} <name>"
echo " Name of the Proxmox Storage container (Eg. local-zfs, local-lvm, etc)"
Expand Down
10 changes: 8 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ wget https://raw.githubusercontent.com/thushan/proxmox-vm-to-ct/main/proxmox-vm-
chmod +x ./proxmox-vm-to-ct.sh
```

Once downloaded, to create an container for the vm '`the-matrix`' named '`matrix-reloaded`' with the [default CT configuration](#default-configuration) on your pve storage `local-zfs`:
Once downloaded, to create an container for the vm with the hostname '`the-matrix`' named '`matrix-reloaded`' with the [default CT configuration](#default-configuration) on your pve storage `local-zfs`:

```shell
./proxmox-vm-to-ct.sh --source the-matrix \
Expand All @@ -49,6 +49,8 @@ If your VM has docker, podman or containerd installed, use the `--default-config
--default-config-containerd
```

You can use the fully qualified host name (Eg. `the-matrix` or `the-matrix.fritz.box`) or the IP (Eg. `192.168.0.101`) of the source VM you want to convert - we SSH in, to get the files.

See further [examples](#Examples) below.

> \[!TIP]
Expand Down Expand Up @@ -237,13 +239,17 @@ See what's included with [default containerd](#default-configuration---container

## Usage
```
Usage: proxmox-vm-to-ct.sh --source <hostname> --target <name> --storage <name> [options]
Usage: proxmox-vm-to-ct.sh --storage <name> --source <hostname|file> --target <name> [options]
Options:
--storage <name>
Name of the Proxmox Storage container (Eg. local-zfs, local-lvm, etc)
--source <hostname> | <file: *.tar.gz>
Source VM to convert to CT (Eg. postgres-vm.fritz.box or 192.168.0.10, source-vm.tar.gz file locally)
--source-user <username>
Source VM's SSH username to connect with. (Eg. root)
--source-port <port>
Source VM's SSH port to connect to. (Eg. 22)
--source-output <path>, --output <path>, -o <path>
Location of the source VM output (default: /tmp/proxmox-vm-to-ct/<hostname>.tar.gz)
--target <name>
Expand Down

0 comments on commit f3f586b

Please sign in to comment.