Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues when using template with --user-data-file / --user-data-filepath - always uses hostname "ranchergui" and doesn't apply config #36

Open
ne0YT opened this issue Jul 6, 2023 · 10 comments
Assignees

Comments

@ne0YT
Copy link

ne0YT commented Jul 6, 2023

I tried to deploy a vm like this:

harvester-cli vm create --template ubuntu2204cloudinit caddy --user-data-filepath 002_ubuntu2204_cloudconfig_CADDY.yaml --network-data-filepath 002_ubuntu2204_cloudconfig_CADDY_NETWORK.yaml

it will always set the hostname "ranchergui" even though I defined "caddy".

I also tried using "--user-data-file". and I also tried using ./002_ubuntu2204_cloudconfig_CADDY.yaml (the files are in the same path as I'm in when running the command)

when I use the yaml-data manually and just paste it in the regaridng fields it works without any problem.

@ne0YT
Copy link
Author

ne0YT commented Jul 6, 2023

I built from sources using "go install" in ubuntu 22.04

@ne0YT
Copy link
Author

ne0YT commented Jul 6, 2023

when I check cloudconfig in harvester gui it shows the one from the template. and it alos runs it instea dof replacing it and it also doesn't use the vlaues from --disk-size, --cpus, --memory,

@ne0YT
Copy link
Author

ne0YT commented Jul 6, 2023

the issue also occurs when using the full path to the .yaml -files.

@ne0YT
Copy link
Author

ne0YT commented Jul 20, 2023

@belgaied2 Hey there :)
Just wanted to ask if it's going to happen :)

@belgaied2 belgaied2 self-assigned this Jul 20, 2023
@belgaied2
Copy link
Owner

Hi @ne0YT , sorry for not replying since a long time. I have been very busy with my work, and did not spend time on Harvester CLI. So, it looks like my latest implementations did not work correctly.
I will try to reproduce this and let you know.

@belgaied2
Copy link
Owner

belgaied2 commented Jul 20, 2023

I think I figured out your issue @ne0YT. You are putting the name of the VM too early. In my case, if I do this:

go run main.go vm create --template ubuntu-template:1 hello-world --disk-size 50Gi -c 4 -m 8Gi

Harvester CLI would completely ignore the --disk-size 50Gi -c 4 -m 8Gi and would create in my case a VM with 25Gi disk, 2 CPUs and 4 Gi RAM. However, if I run it with

go run main.go vm create --template ubuntu-template:1 --disk-size 50Gi -c 4 -m 8Gi hello-world-2

image

More information about this, refer to this issue in upstream urfave/cli, which was closed without resolution.

@ne0YT
Copy link
Author

ne0YT commented Jul 20, 2023

hey there. Thank you, it seems to fix that part but smh I cannot use cloudinit with it rn;

harvester-cli vm create --template ubuntu2204cloudinit --user-data-filepath ./004_ubuntu2204_cloudconfig_Nextcloud.yaml --network-data-filepath ./004_ubuntu2204_cloudconfig_Nextcloud_NETWORK.yaml --disk-size 100Gi -c 12 -m 12Gi nextcloud
WARN[0000] You are using a template flag, please be aware that:
Flags: --disk-size, --cpus, --memory, --user-data-* and --network-data-* will override the template.
Any other flag will be IGNORED! 
FATA[0000] admission webhook "virtualmachine-validator.kubevirt.io" denied the request: spec.template.spec.volumes[1].cloudInitNoCloud must have only one userdatasource set., spec.template.spec.volumes[1].cloudInitNoCloud must have only one networkdata source set.

and --namespace only works if the template is in the same namespace too right?

@ne0YT
Copy link
Author

ne0YT commented Jul 26, 2023

@belgaied2 were you able to use "--user-data-*" yourself?

@ne0YT
Copy link
Author

ne0YT commented Aug 11, 2023

@belgaied2
did you test the vm migration part?

@ne0YT
Copy link
Author

ne0YT commented Sep 5, 2023

@belgaied2
hey there
will you continue this project, or should I check for another way of interacting using scripts with harvester?
maybe you can direct me somewhere :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants