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

Volsnap error 16 #149

Open
Lior97 opened this issue Jul 29, 2024 · 13 comments
Open

Volsnap error 16 #149

Lior97 opened this issue Jul 29, 2024 · 13 comments

Comments

@Lior97
Copy link

Lior97 commented Jul 29, 2024

When Im using cloudbase and create a shadow copy , when i restart my machine I get this error which tells me the disks I added getting force dismount which cause the deletion of the shadow copies I made.
When I comment the line of the metadata in the config file the shadow copies doesnt get deleted.
Any idea of what can fix it?

@ader1990
Copy link
Member

ader1990 commented Aug 5, 2024

Hello @Lior97,

Can you give some details on the comment the line of the metadata in the config file ? Also, if you can give more details on how to reproduce the issue.

There might be an issue related to https://cloudbase-init.readthedocs.io/en/1.1.6/plugins.html#san-policy-config-main, but I need more information on how to reproduce the issue.

Thank you,
Adrian Vladu

@Lior97
Copy link
Author

Lior97 commented Aug 5, 2024 via email

@Lior97
Copy link
Author

Lior97 commented Aug 5, 2024 via email

@ader1990
Copy link
Member

ader1990 commented Aug 5, 2024

Can you also share the cloudbase-init configuration files and logs when the issue appears? Also, if you can share how the shadow copied were created, to try to reproduce the issue.

@Lior97
Copy link
Author

Lior97 commented Aug 5, 2024 via email

@ader1990
Copy link
Member

ader1990 commented Aug 5, 2024

Thanks. I have tried to reproduce the issue, but could not so far, all the extra volumes I added were showing the shadow copies fine after cloudbase-init run and a reboot.

@Lior97
Copy link
Author

Lior97 commented Aug 5, 2024 via email

@ader1990
Copy link
Member

ader1990 commented Aug 5, 2024

which os version do you using?

On Mon, 5 Aug 2024 at 13:38, Adrian Vladu @.> wrote: Thanks. I have tried to reproduce the issue, but could not so far, all the extra volumes I added were showing the shadow copies fine after cloudbase-init run and a reboot. — Reply to this email directly, view it on GitHub <#149 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR4JQEEIZEGH7WXXSY2YQDLZP5I2PAVCNFSM6AAAAABLTT4ACSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRYG42TINRVHA . You are receiving this because you were mentioned.Message ID: @.>

I ran a small test with the 10.0.20348 Windows Server 2022 Datacenter trial version. To continue the debug, please provide the following:

  • OS version (systeminfo.exe)
  • disk information (get-diskdrive) + details on what the disk type is, how the disks are attached or detached during boot / after boot. Also, any details if your environment is baremetal or virtualized (disk types, virtualization type, etc). More, the better.
  • how the Windows image has been created and if there is any special customization related to the SAN policy(diskpart> san).
  • cloudbase-init logs
  • any other information that you consider to be relevant to be able to reproduce the environment and the issue
  • what is the error message (or printscreen) and what is the desired outcome
  • is the issue happening at every boot or just happens in certain conditions?

Once we have the full information, I can try to better reproduce it.

@Lior97
Copy link
Author

Lior97 commented Aug 5, 2024 via email

@ader1990
Copy link
Member

ader1990 commented Aug 5, 2024

The cloudbase-init service should not do in any way a force dismount of the disk.

One possibility, from the config file you shared, is that the only enabled plugin might do something: plugins=cloudbaseinit.plugins.common.userdata.UserDataPlugin. But the run logs are needed to confirm or not this possibility.

Also, is it possible to share the userdata script that is being run?

@Lior97
Copy link
Author

Lior97 commented Aug 6, 2024

0bytes
eventViewer
eventViewerAfterRestart

conf:
[DEFAULT]
metadata_file=meta_data.json
userdata_file=user_data
username="NT AUTHORITY\SYSTEM"
groups=Administrators
first_logon_behaviour=no
check_latest_version=false
enable_automatic_updates=false
stop_service_on_exit=false
cdrom=true
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin
verbose=true
debug=true
log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log
log_file=cloudbase-init.log
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
userdata_save_path=C:\Windows\Temp\CloudBaseData
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService,cloudbaseinit.metadata.services.base.EmptyMetadataService
plugins=cloudbaseinit.plugins.common.userdata.UserDataPlugin

og:
2024-08-06 10:01:02.744 776 INFO cloudbaseinit.init [-] Cloudbase-Init version: 1.1.4
2024-08-06 10:01:02.744 776 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.userdata.UserDataPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2024-08-06 10:01:02.775 776 INFO cloudbaseinit.init [-] Executing plugins for stage 'PRE_NETWORKING':
2024-08-06 10:01:02.775 776 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.userdata.UserDataPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2024-08-06 10:01:02.775 776 INFO cloudbaseinit.init [-] Executing plugins for stage 'PRE_METADATA_DISCOVERY':
2024-08-06 10:01:02.775 776 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.metadata.services.configdrive.ConfigDriveService' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2024-08-06 10:01:02.791 776 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.metadata.services.osconfigdrive.windows.WindowsConfigDriveManager' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2024-08-06 10:01:02.791 776 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2024-08-06 10:01:02.791 776 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for Config Drive iso in hdd with expected label config-2 get_config_drive_files C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:221
2024-08-06 10:01:02.807 776 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for Config Drive iso in partition with expected label config-2 get_config_drive_files C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:221
2024-08-06 10:01:02.947 776 WARNING cloudbaseinit.metadata.services.osconfigdrive.windows [-] ISO extraction failed on <Partition: \?\GLOBALROOT\Device\Harddisk0\Partition2> with WindowsCloudbaseInitException("Cannot open file: 'The process cannot access the file because it is being used by another process.'"): cloudbaseinit.exception.WindowsCloudbaseInitException: Cannot open file: 'The process cannot access the file because it is being used by another process.'
2024-08-06 10:01:02.947 776 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for Config Drive iso in cdrom with expected label config-2 get_config_drive_files C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:221
2024-08-06 10:01:02.947 776 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for a Config Drive with label 'config-2' on 'D:'. Found mismatching label 'None'. _check_for_config_drive C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:68
2024-08-06 10:01:02.947 776 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for Config Drive vfat in hdd with expected label config-2 get_config_drive_files C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:221
2024-08-06 10:01:03.009 776 DEBUG cloudbaseinit.utils.windows.vfat [-] Could not retrieve label for VFAT drive path '\\.\PHYSICALDRIVE1' is_vfat_drive C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\windows\vfat.py:45
2024-08-06 10:01:03.009 776 DEBUG cloudbaseinit.utils.windows.vfat [-] mlabel failed with error b"init :: sector size (190) not a small power of two\r\nCannot initialize '::'\r\nC:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\mlabel: Cannot initialize drive\r\n" is_vfat_drive C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\windows\vfat.py:47
2024-08-06 10:01:03.009 776 DEBUG cloudbaseinit.utils.windows.vfat [-] Could not retrieve label for VFAT drive path '\\.\PHYSICALDRIVE0' is_vfat_drive C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\windows\vfat.py:45
2024-08-06 10:01:03.009 776 DEBUG cloudbaseinit.utils.windows.vfat [-] mlabel failed with error b"init :: sector size (190) not a small power of two\r\nCannot initialize '::'\r\nC:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\mlabel: Cannot initialize drive\r\n" is_vfat_drive C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\windows\vfat.py:47
2024-08-06 10:01:03.009 776 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for Config Drive vfat in partition with expected label config-2 get_config_drive_files C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:221
2024-08-06 10:01:03.009 776 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for a Config Drive with label 'config-2' on '\?\Volume{1f7df349-0000-0000-0000-100000000000}'. Found mismatching label 'System Reserved'. _check_for_config_drive C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:68
2024-08-06 10:01:03.009 776 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for a Config Drive with label 'config-2' on '\?\Volume{0ec29355-d9af-4f30-bf90-7d34b5002430}'. Found mismatching label 'NewVolume'. _check_for_config_drive C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:68
2024-08-06 10:01:03.009 776 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for a Config Drive with label 'config-2' on '\?\Volume{1f7df349-0000-0000-0000-500600000000}'. Found mismatching label ''. _check_for_config_drive C:\Program

packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:204
2024-08-06 10:02:03.947 2520 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for Config Drive iso in partition with expected label config-2 get_config_drive_files C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:221
2024-08-06 10:02:04.150 2520 WARNING cloudbaseinit.metadata.services.osconfigdrive.windows [-] ISO extraction failed on <Partition: \?\GLOBALROOT\Device\Harddisk0\Partition2> with WindowsCloudbaseInitException("Cannot open file: 'The process cannot access the file because it is being used by another process.'"): cloudbaseinit.exception.WindowsCloudbaseInitException: Cannot open file: 'The process cannot access the file because it is being used by another process.'
2024-08-06 10:02:04.150 2520 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for Config Drive iso in hdd with expected label config-2 get_config_drive_files C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:221
2024-08-06 10:02:04.150 2520 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for Config Drive iso in cdrom with expected label config-2 get_config_drive_files C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:221
2024-08-06 10:02:04.150 2520 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for a Config Drive with label 'config-2' on 'D:'. Found mismatching label 'None'. _check_for_config_drive C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:68
2024-08-06 10:02:04.150 2520 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.metadata.services.base.EmptyMetadataService' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2024-08-06 10:02:04.150 2520 INFO cloudbaseinit.init [-] Metadata service loaded: 'EmptyMetadataService'
2024-08-06 10:02:04.150 2520 DEBUG cloudbaseinit.init [-] Instance id: None configure_host C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\init.py:202
2024-08-06 10:02:04.150 2520 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.userdata.UserDataPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2024-08-06 10:02:04.150 2520 INFO cloudbaseinit.init [-] Executing plugins for stage 'MAIN':
2024-08-06 10:02:04.150 2520 INFO cloudbaseinit.init [-] Executing plugin 'UserDataPlugin'
2024-08-06 10:02:04.150 2520 INFO cloudbaseinit.init [-] Plugins execution done

the cloudbase-init purpse for my goals is to run the powershell script that is in the user_data file and it's modules in the /openstack/content.
and I wish for the cloudbase-init to utilze the NT AUTHORITY\SYSTEM account for the task.

@ader1990
Copy link
Member

ader1990 commented Aug 7, 2024

Hello,

From the logs that you shared, I do not see any possible causes for the force dismount of the E: drive and I do not see the cause of cloudbase-init service exiting with error code (terminated unexpectedly). What is the E: drive - a QEMU scsi/virtio/ide disk and how was it attached? And the error can be reproduced every time cloudbase-init runs?

Also, Metadata service loaded: 'EmptyMetadataService' -> means that there was no config-drive attached to the VM and the only plugin plugins=cloudbaseinit.plugins.common.userdata.UserDataPlugin cannot run without a metadata service that provides the user data. EmptyMetadataService should be used in case you want to run only the ExtendVolume or LocalScripts plugins, that do not require user data or meta data.

This key-value - username="NT AUTHORITY\SYSTEM" is meant for cloudbase-init to create that user, and not to have cloudbase-init service run under that user. To achieve a similar thing, you will need to install the Cloudbase-Init MSI with the LocalSystem checkbox activated (to run under the LocalSystem user. NT AUTHORITY\SYSTEM is not a Windows user, as far as I know). One can automate such MSI installation using https://github.com/cloudbase/windows-imaging-tools/blob/master/UnattendResources/Logon.ps1#L637.

Creating a working Windows image can get quite tedious at times, I might suggest using this tool https://github.com/cloudbase/windows-imaging-tools, as it automates the whole process of creating an image.

Thanks.

@Lior97
Copy link
Author

Lior97 commented Aug 8, 2024

Thank you for the time you take for this.
I will try the tools but i'm still trying to make sure that Cloudbase doesn't have anything to do with the Shadow Copy with my configurations.

This is a fresh STD 22 OS with Cloudbase 1.1.6

updated conf file:
[DEFAULT]
username="NT AUTHORITY\SYSTEM"
groups=Administrators
first_logon_behaviour=no
check_latest_version=false
enable_automatic_updates=false
stop_service_on_exit=false
cdrom=true
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin
log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log
log_file=cloudbase-init.log
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
verbose=true
debug=true
metadata_file=meta_data.json
userdata_file=user_data
userdata_save_path=C:\Windows\Temp\CloudBaseData
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService

event1
event2
event3
cloudbase-init.log

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

No branches or pull requests

2 participants