-
Notifications
You must be signed in to change notification settings - Fork 612
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
generate qemu vm uuid #754
base: master
Are you sure you want to change the base?
Conversation
@@ -425,6 +427,7 @@ func Cmdline(cfg Config) (string, []string, error) { | |||
|
|||
// QEMU process | |||
args = append(args, "-name", "lima-"+cfg.Name) | |||
args = append(args, "-uuid", uuid.NewMD5(uuid.NameSpaceOID, []byte(cfg.Name)).String() ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For universal uniqueness, can we generate a random UUID and save it as “uuid” file in the instance dir?
lima/pkg/store/filenames/filenames.go
Lines 25 to 45 in 3aca16d
// Filenames that may appear under an instance directory | |
const ( | |
LimaYAML = "lima.yaml" | |
CIDataISO = "cidata.iso" | |
BaseDisk = "basedisk" | |
DiffDisk = "diffdisk" | |
QemuPID = "qemu.pid" | |
QMPSock = "qmp.sock" | |
SerialLog = "serial.log" | |
SerialSock = "serial.sock" | |
SSHSock = "ssh.sock" | |
GuestAgentSock = "ga.sock" | |
HostAgentPID = "ha.pid" | |
HostAgentSock = "ha.sock" | |
HostAgentStdoutLog = "ha.stdout.log" | |
HostAgentStderrLog = "ha.stderr.log" | |
// SocketDir is the default location for forwarded sockets with a relative paths in HostSocket | |
SocketDir = "sock" | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
( no need to save the uuid as a file if you adopt Jan’s approach #754 (comment) )
Thanks, but please sign the commit for DCO (run |
To have a globally unique, but persistent (accross VM restarts) id we include both the machine id and the full path to the VM directory: Line 44 in 3aca16d
The instance name alone isn't even locally unique because you can have multiple I would suggest to extract the |
@dictcp Hi, are you still working on this PR? I need it too. |
@junnplus Feel free to open a new PR to carry this (if you would like to) |
Background
Some application may requires the
product_uuid
from sysfs, OR it will be broken, eg.The patch will generate a UUID, based of the MD5 sum of the VM name, and append as qemu
--uuid
parameter.It should be safe and no impact to others usecase.