Public bug reported:

[Issue]

After rebooting a 16.04 AWS instance (ami-1d4e7a66) with several
external disks attached, formatted, and added to /etc/fstab - systemd
mount targets fail to mount with:

● media-v.mount - /media/v
   Loaded: loaded (/etc/fstab; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2017-09-19 20:12:18 UTC; 1min 
54s ago
    Where: /media/v
     What: /dev/xvdv
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
  Process: 1196 ExecMount=/bin/mount /dev/xvdv /media/v -t ext4 -o defaults 
(code=exited, status=32)

Sep 19 20:12:17 ip-172-31-7-167 systemd[1]: Mounting /media/v...
Sep 19 20:12:17 ip-172-31-7-167 mount[1196]: mount: /dev/xvdv is already 
mounted or /media/v busy
Sep 19 20:12:18 ip-172-31-7-167 systemd[1]: media-v.mount: Mount process 
exited, code=exited status=32
Sep 19 20:12:18 ip-172-31-7-167 systemd[1]: Failed to mount /media/v.
Sep 19 20:12:18 ip-172-31-7-167 systemd[1]: media-v.mount: Unit entered failed 
state.


>From the cloud-init logs, it appears that the the OVF datasource is mounting 
>the device to find data:

2017-09-19 20:12:17,502 - util.py[DEBUG]: Peeking at /dev/xvdv (max_bytes=512)
2017-09-19 20:12:17,502 - util.py[DEBUG]: Reading from /proc/mounts 
(quiet=False)
2017-09-19 20:12:17,502 - util.py[DEBUG]: Read 2570 bytes from /proc/mounts
...
2017-09-19 20:12:17,506 - util.py[DEBUG]: Running command ['mount', '-o', 
'ro,sync', '-t', 'iso9660', '/dev/xvdv', '/tmp/tmpw2tyqqid'] with allowed 
return codes [0] (shell=False, capture=True)
2017-09-19 20:12:17,545 - util.py[DEBUG]: Failed mount of '/dev/xvdv' as 
'iso9660': Unexpected error while running command.
Command: ['mount', '-o', 'ro,sync', '-t', 'iso9660', '/dev/xvdv', 
'/tmp/tmpw2tyqqid']
Exit code: 32
Reason: -
Stdout: -
Stderr: mount: wrong fs type, bad option, bad superblock on /dev/xvdv,
               missing codepage or helper program, or other error
        
               In some cases useful info is found in syslog - try
               dmesg | tail or so.
2017-09-19 20:12:17,545 - util.py[DEBUG]: Recursively deleting /tmp/tmpw2tyqqid
2017-09-19 20:12:17,545 - DataSourceOVF.py[DEBUG]: /dev/xvdv not mountable as 
iso9660


[Vitals]

Version: 0.7.9-153-g16a7302f-0ubuntu1~16.04.2
OS: Ubuntu 16.04
Provider: AWS - ami-1d4e7a66

[Recreate]

To recreate this

1. Launch an AWS instance using AMI ami-1d4e7a66 and attach several
disks (I used 25 additional disks)

2. Format and mount all 25:
   mkdir /media/{b..z}
   for i in {b..z}; do 
       mkfs -t ext4 /dev/xvd$i
       mount /dev/xvd$i /media/$i
       echo "/dev/xvd$i /media/$i ext4 defaults,nofail 0 2" >> /etc/fstab
   done

3. reboot instance

Since this is a race, multiple may be necessary. A reproducer script is
attached.

** Affects: cloud-init
     Importance: Undecided
         Status: New


** Tags: sts

** Attachment added: "cloud-init.tar"
   
https://bugs.launchpad.net/bugs/1718287/+attachment/4953081/+files/cloud-init.tar

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1718287

Title:
  systemd mount targets fail due to device busy or already mounted

Status in cloud-init:
  New

Bug description:
  [Issue]

  After rebooting a 16.04 AWS instance (ami-1d4e7a66) with several
  external disks attached, formatted, and added to /etc/fstab - systemd
  mount targets fail to mount with:

  ● media-v.mount - /media/v
     Loaded: loaded (/etc/fstab; bad; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2017-09-19 20:12:18 UTC; 1min 
54s ago
      Where: /media/v
       What: /dev/xvdv
       Docs: man:fstab(5)
             man:systemd-fstab-generator(8)
    Process: 1196 ExecMount=/bin/mount /dev/xvdv /media/v -t ext4 -o defaults 
(code=exited, status=32)

  Sep 19 20:12:17 ip-172-31-7-167 systemd[1]: Mounting /media/v...
  Sep 19 20:12:17 ip-172-31-7-167 mount[1196]: mount: /dev/xvdv is already 
mounted or /media/v busy
  Sep 19 20:12:18 ip-172-31-7-167 systemd[1]: media-v.mount: Mount process 
exited, code=exited status=32
  Sep 19 20:12:18 ip-172-31-7-167 systemd[1]: Failed to mount /media/v.
  Sep 19 20:12:18 ip-172-31-7-167 systemd[1]: media-v.mount: Unit entered 
failed state.

  
  From the cloud-init logs, it appears that the the OVF datasource is mounting 
the device to find data:

  2017-09-19 20:12:17,502 - util.py[DEBUG]: Peeking at /dev/xvdv (max_bytes=512)
  2017-09-19 20:12:17,502 - util.py[DEBUG]: Reading from /proc/mounts 
(quiet=False)
  2017-09-19 20:12:17,502 - util.py[DEBUG]: Read 2570 bytes from /proc/mounts
  ...
  2017-09-19 20:12:17,506 - util.py[DEBUG]: Running command ['mount', '-o', 
'ro,sync', '-t', 'iso9660', '/dev/xvdv', '/tmp/tmpw2tyqqid'] with allowed 
return codes [0] (shell=False, capture=True)
  2017-09-19 20:12:17,545 - util.py[DEBUG]: Failed mount of '/dev/xvdv' as 
'iso9660': Unexpected error while running command.
  Command: ['mount', '-o', 'ro,sync', '-t', 'iso9660', '/dev/xvdv', 
'/tmp/tmpw2tyqqid']
  Exit code: 32
  Reason: -
  Stdout: -
  Stderr: mount: wrong fs type, bad option, bad superblock on /dev/xvdv,
                 missing codepage or helper program, or other error
          
                 In some cases useful info is found in syslog - try
                 dmesg | tail or so.
  2017-09-19 20:12:17,545 - util.py[DEBUG]: Recursively deleting 
/tmp/tmpw2tyqqid
  2017-09-19 20:12:17,545 - DataSourceOVF.py[DEBUG]: /dev/xvdv not mountable as 
iso9660

  
  [Vitals]

  Version: 0.7.9-153-g16a7302f-0ubuntu1~16.04.2
  OS: Ubuntu 16.04
  Provider: AWS - ami-1d4e7a66

  [Recreate]

  To recreate this

  1. Launch an AWS instance using AMI ami-1d4e7a66 and attach several
  disks (I used 25 additional disks)

  2. Format and mount all 25:
     mkdir /media/{b..z}
     for i in {b..z}; do 
         mkfs -t ext4 /dev/xvd$i
         mount /dev/xvd$i /media/$i
         echo "/dev/xvd$i /media/$i ext4 defaults,nofail 0 2" >> /etc/fstab
     done

  3. reboot instance

  Since this is a race, multiple may be necessary. A reproducer script
  is attached.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1718287/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to