{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/compute-image-tools/issues/130","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/compute-image-tools","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/compute-image-tools/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/compute-image-tools/issues/130/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/compute-image-tools/issues/130/events","html_url":"https://github.com/GoogleCloudPlatform/compute-image-tools/issues/130","id":252100096,"number":130,"title":" translate_el.sh: fail to chroot","user":{"login":"helen-fornazier","id":11065451,"avatar_url":"https://avatars1.githubusercontent.com/u/11065451?v=4","gravatar_id":"","url":"https://api.github.com/users/helen-fornazier","html_url":"https://github.com/helen-fornazier","followers_url":"https://api.github.com/users/helen-fornazier/followers","following_url":"https://api.github.com/users/helen-fornazier/following{/other_user}","gists_url":"https://api.github.com/users/helen-fornazier/gists{/gist_id}","starred_url":"https://api.github.com/users/helen-fornazier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helen-fornazier/subscriptions","organizations_url":"https://api.github.com/users/helen-fornazier/orgs","repos_url":"https://api.github.com/users/helen-fornazier/repos","events_url":"https://api.github.com/users/helen-fornazier/events{/privacy}","received_events_url":"https://api.github.com/users/helen-fornazier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-08-22T21:51:04Z","updated_at":"2017-09-07T03:08:50Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"For both Centos 7 and RHEL 7 I get the error below, I'll dig more to find a solution.\r\nThe exist point is when it tries to execute the following and fails:\r\n  `chroot ${MNT} yum -y install google-compute-engine google-compute-engine-init google-config`\r\nOther errors are also present\r\n\r\n```\r\nDebian GNU/Linux 9 inst-translator-translate-centos-7-translate-disk-stvzt ttyS0\r\n\r\ninst-translator-translate-centos-7-translate-disk-stvzt login: Aug 22 20:52:46 localhost google_metadata_script_runner[705]: Copying gs://main-nucleus-128012-daisy-bkt/daisy-translate-centos-7-20170822-20:51:58-stvzt/sources/translate_el.sh...\r\nAug 22 20:52:46 localhost google_metadata_script_runner[705]: / [0 files][    0.0 B/  4.0 KiB]                                                #015/ [1 files][  4.0 KiB/  4.0 KiB]\r\nAug 22 20:52:46 localhost google_metadata_script_runner[705]: Operation completed over 1 objects/4.0 KiB.\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: + URL=http://metadata/computeMetadata/v1/instance/attributes\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: ++ curl -f -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/el_release\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url:                                  Dload  Upload   Total   Spent    Left  Speed\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: #015  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0#015100     1  100     1    0     0     66      0 --:--:-- --:--:-- --:--:--    71\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: + EL_RELEASE=7\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: ++ curl -f -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/install_gce_packages\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url:                                  Dload  Upload   Total   Spent    Left  Speed\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: #015  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0#015100     4  100     4    0 [   37.194660] SGI XFS with ACLs, security attributes, realtime, no debug enabled\r\n    0    671      0 --:--:-- --:[   37.205338] XFS (sdb1): Mounting V4 Filesystem\r\n--:-- --:--:--   800\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: + INSTALL_GCE=true\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: ++ curl -f -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/use_rhel_gce_license\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url:                                  Dload  Upload   Total   Spent    Left  Speed\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: #015  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0#015100     5  100     5    0     0    835      0 --:--:-- --:--:-- --:--:--  1000\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: + RHEL_LICENSE=false\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: + MNT=/mnt/imported_disk\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: + mkdir /mnt/imported_disk\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: + '[' -b /dev/sdb1 ']'\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: + echo 'Trying to mount /dev/sdb1'\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: Trying to mount /dev/sdb1\r\nAug 22 20:52:46 localhost startup-script: INFO startup-script-url: + mount /dev/sdb1 /mnt/imported_disk\r\nAug 22 20:52:47 localhost kernel: [   37.194660] SGI XFS with ACLs, security attributes, realtime, no debug enabled\r\nAug 22 20:52:47 localhost kernel: [   37.205338] XFS (sdb1): Mounting V4 Filesystem\r\n[   38.631959] random: crng init done\r\nAug 22 20:52:48 localhost kernel: [   38.631959] random: crng init done\r\n[   40.274745] XFS (sdb1): Ending clean mount\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + '[' 0 -ne 0 ']'\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + for f in proc sys dev run\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + mount -o bind /proc /mnt/imported_disk/proc\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: mount: mount point /mnt/imported_disk/proc does not exist\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + for f in proc sys dev run\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + mount -o bind /sys /mnt/imported_disk/sys\r\nAug 22 20:52:50 localhost kernel: [   40.274745] XFS (sdb1): Ending clean mount\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: mount: mount point /mnt/imported_disk/sys does not exist\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + for f in proc sys dev run\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + mount -o bind /dev /mnt/imported_disk/dev\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: mount: mount point /mnt/imported_disk/dev does not exist\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + for f in proc sys dev run\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + mount -o bind /run /mnt/imported_disk/run\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: mount: mount point /mnt/imported_disk/run does not exist\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + cp /etc/resolv.conf /mnt/imported_disk/etc/resolv.conf\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: cp: cannot create regular file '/mnt/imported_disk/etc/resolv.conf': No such file or directory\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + oot /mnt/imported_disk restorecon /etc/resolv.conf\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: /startup-N0dtKF/tmpnDsYM_: line 47: oot: command not found\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + [[ '' == \\t\\r\\u\\e ]]\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + [[ true == \\t\\r\\u\\e ]]\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + echo 'Installing GCE packages.'\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: Installing GCE packages.\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + cat\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: /startup-N0dtKF/tmpnDsYM_: line 64: /etc/yum.repos.d/google-cloud.repo: No such file or directory\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + [[ 7 == \\7 ]]\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + cat\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: /startup-N0dtKF/tmpnDsYM_: line 76: /etc/yum.repos.d/google-cloud.repo: No such file or directory\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + chroot /mnt/imported_disk yum -y install google-cloud-sdk\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: chroot: failed to run command â€˜yumâ€™: No such file or directory\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + chroot /mnt/imported_disk yum -y install google-compute-engine google-compute-engine-init google-config\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: chroot: failed to run command â€˜yumâ€™: No such file or directory\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + '[' 127 -ne 0 ']'\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + echo 'TranslateFailed: GCE package install failed.'\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: TranslateFailed: GCE package install failed.\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: + exit 1\r\nAug 22 20:52:50 localhost startup-script: INFO startup-script-url: Return code 1.\r\nAug 22 20:52:50 localhost startup-script: INFO Finished running startup scripts.\r\nAug 22 20:52:50 localhost systemd[1]: Started Google Compute Engine Startup Scripts.\r\nAug 22 20:52:50 localhost systemd[1]: Reached target Multi-User System.\r\nAug 22 20:52:50 localhost systemd[1]: Reached target Graphical Interface.\r\nAug 22 20:52:50 localhost systemd[1]: Starting Update UTMP about System Runlevel Changes...\r\nAug 22 20:52:50 localhost systemd[1]: Started Update UTMP about System Runlevel Changes.\r\nAug 22 20:52:50 localhost systemd[1]: Startup finished in 1.170s (kernel) + 38.823s (userspace) = 39.993s.\r\n\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/compute-image-tools/issues/comments/327671186","html_url":"https://github.com/GoogleCloudPlatform/compute-image-tools/issues/130#issuecomment-327671186","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/compute-image-tools/issues/130","id":327671186,"user":{"login":"helen-fornazier","id":11065451,"avatar_url":"https://avatars1.githubusercontent.com/u/11065451?v=4","gravatar_id":"","url":"https://api.github.com/users/helen-fornazier","html_url":"https://github.com/helen-fornazier","followers_url":"https://api.github.com/users/helen-fornazier/followers","following_url":"https://api.github.com/users/helen-fornazier/following{/other_user}","gists_url":"https://api.github.com/users/helen-fornazier/gists{/gist_id}","starred_url":"https://api.github.com/users/helen-fornazier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helen-fornazier/subscriptions","organizations_url":"https://api.github.com/users/helen-fornazier/orgs","repos_url":"https://api.github.com/users/helen-fornazier/repos","events_url":"https://api.github.com/users/helen-fornazier/events{/privacy}","received_events_url":"https://api.github.com/users/helen-fornazier/received_events","type":"User","site_admin":false},"created_at":"2017-09-07T03:08:50Z","updated_at":"2017-09-07T03:08:50Z","author_association":"CONTRIBUTOR","body":"The problem of using guestmount, is that grub2-mkconfig generates the wrong rootfs parameter, so the system doesn't boot and only the dracut shell is loaded. Using virt-customize for this solves the problem, but it is not that easy to pass a bash script to virt-customize.\r\nSo I wrote a script in python that seems to solve most of our problems, the only ugly thing is that I mixed bash with python for now to be able to install the python libraries before executing the python script (but this is temporary, only for the proof of concept)\r\n\r\n@zmarano please check: https://github.com/helen-fornazier/compute-image-tools/blob/translate_el/daisy_workflows/image_import/enterprise_linux/translate_el.sh\r\n\r\nTo not mix bash with python in the same file, I was thinking in adding the python in the `Source` list in translate_el.wf.json (a translate_el.py besides the translate_el.sh), but I am not exactly sure how to retrieve the translate_el.py from the translate_el.sh script inside the staging VM, do you have any recommendation regarding this?"}}
{"actor":{"display_login":"helen-fornazier"}}