| Posted | Nick | Remark | |
|---|---|---|---|
| #openstack-nova - 2023-07-27 | |||
| 19:09:14 | dansmith | we have to figure that out, because I think that's wrong (as heck) | |
| 19:09:18 | sean-k-mooney | dansmith: ya i would be ok with always returnning 200 | |
| 19:09:34 | dansmith | but even still, 200 even if it's empty because the operation worked, this is what we have for console log, which may be nothing | |
| 19:09:42 | sean-k-mooney | i said 500 just ebcasue there is a bug in nova | |
| 19:09:48 | sean-k-mooney | but this is part of the interop tests right | |
| 19:09:48 | dansmith | if you have your kernel set to log to something other than tty0 it'll be blank too | |
| 19:09:56 | sean-k-mooney | so this cant have backend depent behavior | |
| 19:10:09 | gmann | yeah empty is still a response we got the console | |
| 19:10:20 | gmann | but console not available? | |
| 19:11:06 | gmann | 'console not available' should be error case right | |
| 19:11:41 | sean-k-mooney | it depends | |
| 19:12:06 | dansmith | it should never be 404, that's for sure | |
| 19:12:11 | gmann | because this fix will get the 404 on console not avaliable for the shutoff Guest https://review.opendev.org/c/openstack/tempest/+/889895 | |
| 19:12:16 | dansmith | because /action exists | |
| 19:12:30 | dansmith | it can be an error maybe if we've never started the guest yet, or *maybe* if it was lost from disk somehow | |
| 19:12:34 | dansmith | but that's different than blank | |
| 19:12:35 | sean-k-mooney | dansmith: i agree on the 404. the depends is more i belive its possibel to have a vm without any console | |
| 19:12:39 | gmann | I think 400 is more appropriate here | |
| 19:13:01 | dansmith | maybe 410 Gone | |
| 19:13:16 | dansmith | Honestly, 4xx means the client messed up and the client hasn't messed up here | |
| 19:13:23 | dansmith | there's also 425 Too Early | |
| 19:13:30 | dansmith | and 428 Precondition Required | |
| 19:13:39 | gmann | but when server is not yet active and console not availble 410 is not right. for shutoff case where console was available but now it is not | |
| 19:14:07 | dansmith | yeah, I really don't understand what use ever returning 4xx for this is | |
| 19:14:12 | gmann | dansmith: but if request is before server is in active or in shutoff state it is client error right? | |
| 19:14:14 | dansmith | maybe on a windows guest where there is no such console? | |
| 19:14:27 | sean-k-mooney | so its not a clinet error so 4XX is incorrect | |
| 19:14:37 | dansmith | gmann: I dunno, it's debatable I think | |
| 19:14:42 | dansmith | maybe if you call it before it's active, | |
| 19:14:57 | sean-k-mooney | the user should be able to expect the console to be ableiable i think if a console exits for the instnace | |
| 19:14:59 | dansmith | but since you shoudl be able to call it in SHUTOFF, that's kinda confusing to the user that doesn't care much | |
| 19:15:10 | gmann | but does nova says console can be available for before guest become active or in shutoff state? | |
| 19:15:29 | sean-k-mooney | yes the console can be avaiable in shutoff | |
| 19:15:43 | gmann | dansmith: humm that is good point | |
| 19:15:47 | sean-k-mooney | gmann: we have a bug in the livbirt drvier where it does not find it properly | |
| 19:15:53 | dansmith | gmann: so maybe if the instance isn't scheduled to a host yet, then 400 makes sense | |
| 19:16:04 | dansmith | but after it's on a host, I dunno, seems like 200 empty is the right move always | |
| 19:16:18 | gmann | yeah, it is difficult to make differentiation on those cases | |
| 19:16:43 | dansmith | so instance.host==None, 4xxsomething, but otherwise, I'd say 200 empty | |
| 19:16:57 | gmann | +1 | |
| 19:17:12 | sean-k-mooney | hehe ok fun | |
| 19:17:12 | dansmith | I don't think there's any useful distinction between "nothing has ever been written to the console" and "the console log is gone" | |
| 19:17:24 | sean-k-mooney | dansmith: so my boot form volume guest is not using a pty | |
| 19:17:25 | dansmith | like I said, *maybe* for a windows guest with no actual console, I dunno how that works really | |
| 19:17:38 | dansmith | even macos on uefi has a text console.. it's set to silent by default, but it's there | |
| 19:17:43 | gmann | I think I got your point of action is passed so it should be 200 irrespective of what output it give | |
| 19:17:57 | dansmith | gmann: yeah | |
| 19:18:10 | sean-k-mooney | dansmith: https://paste.opendev.org/show/bvGBKyn5fHQthz8TO13C/ | |
| 19:18:25 | dansmith | sean-k-mooney: interesting | |
| 19:18:36 | sean-k-mooney | dansmith: so its using tcp for the console | |
| 19:18:47 | sean-k-mooney | and the source is still there when its stoped | |
| 19:19:06 | dansmith | yeah, I dunno why that is set that way, but I can't imagine it has much to do with being lvm | |
| 19:19:26 | sean-k-mooney | that becasue its kolla-ansible i think | |
| 19:19:36 | dansmith | yeah *that* I'd believe :) | |
| 19:19:46 | sean-k-mooney | again this is related to how libvirt is configured | |
| 19:20:05 | sean-k-mooney | since its generating that so its connecting to virtlogd over tcp in this case | |
| 19:20:37 | sean-k-mooney | well to qemu i guess not virtlogd | |
| 19:21:10 | sean-k-mooney | this deployment is using molitic libvirt | |
| 19:22:03 | sean-k-mooney | dansmith: https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L4464 | |
| 19:22:16 | sean-k-mooney | so if we are usign tcp we get the path form log | |
| 19:22:20 | sean-k-mooney | not source | |
| 19:22:32 | sean-k-mooney | so thats why that is working | |
| 19:22:52 | dansmith | okay but virtlogd should hide this all from us and let us use the log file yeah? | |
| 19:23:08 | sean-k-mooney | yes for qemu/kvm | |
| 19:23:18 | sean-k-mooney | i would need to double check for lxc | |
| 19:23:22 | dansmith | ack | |
| 19:34:05 | sean-k-mooney | https://libvirt.org/formatdomain.html#consoles-serial-parallel-channel-devices is the relevent docs | |
| 19:34:31 | sean-k-mooney | Regardless of the type, character devices can have an optional log file associated with them. This is expressed via a log sub-element, with a file attribute. There can also be an append attribute which takes the same values described above. Since 1.3.3 . | |
| 19:34:56 | dansmith | that implies virtlogd works for everything yeah? | |
| 19:35:03 | dansmith | (as I would expect) | |
| 19:36:44 | sean-k-mooney | implies it yes btu does not actully say it | |
| 19:37:34 | sean-k-mooney | i also cant find anything that would imply how you tell libvirt to chooese the type | |
| 19:37:50 | sean-k-mooney | im going to check my kolla cloud incase it ahs something set in the libvirt configs | |
| 19:38:09 | sean-k-mooney | i suspect pty might be the default or the default in newer libvirts | |
| 19:40:07 | sean-k-mooney | ah found it | |
| 19:40:20 | sean-k-mooney | # The backend to use for handling stdout/stderr output from | |
| 19:40:22 | sean-k-mooney | # QEMU processes. | |
| 19:40:24 | sean-k-mooney | # | |
| 19:40:26 | sean-k-mooney | # 'file': QEMU writes directly to a plain file. This is the | |
| 19:40:28 | sean-k-mooney | # historical default, but allows QEMU to inflict a | |
| 19:40:30 | sean-k-mooney | # denial of service attack on the host by exhausting | |
| 19:40:32 | sean-k-mooney | # filesystem space | |
| 19:40:34 | sean-k-mooney | # | |
| 19:40:36 | sean-k-mooney | # 'logd': QEMU writes to a pipe provided by virtlogd daemon. | |
| 19:40:38 | sean-k-mooney | # This is the current default, providing protection | |
| 19:40:40 | sean-k-mooney | # against denial of service by performing log file | |
| 19:40:42 | sean-k-mooney | # rollover when a size limit is hit. | |
| 19:40:44 | sean-k-mooney | # | |
| 19:40:46 | sean-k-mooney | #stdio_handler = "logd" | |
| 19:41:07 | sean-k-mooney | my kolla cloud is using file | |
| 19:41:18 | dansmith | eesh man, pastebin c'mon | |
| 19:41:42 | dansmith | that's libvirt config? | |
| 19:41:54 | sean-k-mooney | :) sure ya that /etc/libvirt/qemu.conf | |
| 19:42:04 | dansmith | oh, qemu.conf, interesting | |
| 19:42:13 | dansmith | well, I dunno what to say | |
| 19:42:16 | dansmith | we don't support lxc | |
| 19:42:28 | dansmith | I don't want to break it for no reason, but... unless someone is going to try out a change... | |
| 19:42:31 | sean-k-mooney | ill try chanign my lvm devstack to file and see if it changes to tcp | |
| 19:46:19 | sean-k-mooney | no still using pty | |
| 19:46:27 | sean-k-mooney | ok im going ot leave it there today | |