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

tests/container-copy: allow some time for the VM time to stabilize #164

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

simondeziel
Copy link
Member

Fixes canonical/lxd#13388

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
@simondeziel simondeziel marked this pull request as ready for review April 26, 2024 13:31
@tomponline
Copy link
Member

Looks like something unrelated up with the zfs test?

@tomponline tomponline merged commit 6aad18c into canonical:main Apr 26, 2024
62 of 63 checks passed
@simondeziel simondeziel deleted the vm-time-sync branch April 26, 2024 13:56
@simondeziel
Copy link
Member Author

Looks like something unrelated up with the zfs test?

Indeed. This bit of the test relies on the device name to line up with how the devices are added to the instance but I don't know if this is guarantied to be consistent all the time.

I think it would be safer to replace /dev/sdb by /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_block1ro, @tomponline what do you think?

@tomponline
Copy link
Member

makes sense

@simondeziel
Copy link
Member Author

simondeziel commented May 2, 2024

It seems that waiting for the VM time to be in sync wasn't enough (https://github.com/canonical/lxd-ci/actions/runs/8924826611/job/24512039350#step:6:303):

+ echo '==> Wait for the target VM time to be synchronized with NTP'
==> Wait for the target VM time to be synchronized with NTP
++ seq 6
+ for _ in $(seq 6)
++ lxc exec target -- timedatectl show --property=NTPSynchronized --value
+ '[' yes = yes ']'
+ break
+ echo '==> Add the target VM as a remote LXD'
==> Add the target VM as a remote LXD
++ lxc exec target -- lxc config trust add --name host --quiet
+ token=eyJjbGllbnRfbmFtZSI6Imhvc3QiLCJmaW5nZXJwcmludCI6IjY0NjRkZGY3MWIyZTZlZjRhNDBlYTZmY2ZlNzY5Nzg2Zjk0NDc5OTIyYmM4ZWM1OWU0YmMzZmJjZjEzZTM3YTAiLCJhZGRyZXNzZXMiOlsiMTAuMTAyLjExLjEzNTo4NDQzIiwiW2ZkNDI6OTMxODo0YWQ0OmRiY2Q6MjE2OjNlZmY6ZmUxZDo5ZTkyXTo4NDQzIiwiMTAuMTA3LjI1MC4xOjg0NDMiLCJbZmQ0MjplZDc4OjcyYTI6OGRjMzo6MV06ODQ0MyJdLCJzZWNyZXQiOiI2ZTIzOTcxMmRjZGY0YzEzZmZmYWZhOWI5ZTkyNDdlNGZhZjE2MTQ2YzFjMmZhYTE2ZjIzZTllM2ZmNzZlN2NjIiwiZXhwaXJlc19hdCI6IjAwMDEtMDEtMDFUMDA6MDA6MDBaIn0=
+ lxc remote add target eyJjbGllbnRfbmFtZSI6Imhvc3QiLCJmaW5nZXJwcmludCI6IjY0NjRkZGY3MWIyZTZlZjRhNDBlYTZmY2ZlNzY5Nzg2Zjk0NDc5OTIyYmM4ZWM1OWU0YmMzZmJjZjEzZTM3YTAiLCJhZGRyZXNzZXMiOlsiMTAuMTAyLjExLjEzNTo4NDQzIiwiW2ZkNDI6OTMxODo0YWQ0OmRiY2Q6MjE2OjNlZmY6ZmUxZDo5ZTkyXTo4NDQzIiwiMTAuMTA3LjI1MC4xOjg0NDMiLCJbZmQ0MjplZDc4OjcyYTI6OGRjMzo6MV06ODQ0MyJdLCJzZWNyZXQiOiI2ZTIzOTcxMmRjZGY0YzEzZmZmYWZhOWI5ZTkyNDdlNGZhZjE2MTQ2YzFjMmZhYTE2ZjIzZTllM2ZmNzZlN2NjIiwiZXhwaXJlc19hdCI6IjAwMDEtMDEtMDFUMDA6MDA6MDBaIn0= --accept-certificate
Generating a client certificate. This may take a minute...
Error: Failed to create certificate: The provided certificate isn't valid yet

It looks like the host's time is in the future (from a guest's perspective). I'll have to come up with a different solution because even if both the host and the guest are sync'ed with NTP, it doesn't necessarily mean they have fix their delta with real time as this is a long operation.

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