Daniel Ghisleni Posted January 17, 2017 Share Posted January 17, 2017 Hi, I'm getting this error when creating a new SR on a new SSD drive: The SR operation cannot be performed because a device underlying the SR is in use by the host. I saw lots of topics related to this same error, and tried a lot of procedures. None of them worked for me. Below there are the results of the commands I run. Hope some one could help me to create a new SR for using as my VMs HDDs. My new SSD is /dev/sdb. No partitions, no mounting, nothing. Just a new SSD. Thank you in advance. Daniel --- [root@ltsrv02 ~]# xe sr-create content-type=user device-config:device=/dev/disk/by-id/ata-KINGSTON_SUV400S37240G_50026B776A04D2C1 host-uuid=74a2e122-a0f8-4f7a-af66-0e80edddaa87 name-label="Local Storage 2" shared=false type=ext The SR operation cannot be performed because a device underlying the SR is in use by the host. [root@ltsrv02 ~]# cat /var/log/SMlog: [...] Jan 17 18:13:41 ltsrv02 SM: [32406] lock: opening lock file /var/lock/sm/5b71ea78-773f-90ce-e244-89e6acc99e87/sr Jan 17 18:13:41 ltsrv02 SM: [32406] lock: acquired /var/lock/sm/5b71ea78-773f-90ce-e244-89e6acc99e87/sr Jan 17 18:13:41 ltsrv02 SM: [32406] sr_create {'sr_uuid': '5b71ea78-773f-90ce-e244-89e6acc99e87', 'subtask_of': 'DummyRef:|c4388344-f590-a377-38b0-44cfc4497c81|SR.create', 'args': ['0'], 'host_ref': 'OpaqueRef:ad004414-2184-c010-b4b5-e589cc98fc61', 'session_ref': 'OpaqueRef:a7bde17e-948a-ff98-d005-f3fc73ede94d', 'device_config': {'device': '/dev/disk/by-id/ata-KINGSTON_SUV400S37240G_50026B776A04D2C1', 'SRmaster': 'true'}, 'command': 'sr_create', 'sr_ref': 'OpaqueRef:2cbe3260-1f6b-a757-27dc-107269b0f3d4'} Jan 17 18:13:41 ltsrv02 SM: [32406] ['sginfo', '-s', '/dev/sdb'] Jan 17 18:13:41 ltsrv02 SM: [32406] pread SUCCESS Jan 17 18:13:41 ltsrv02 SM: [32406] ['/usr/lib/udev/scsi_id', '-g', '--device', '/dev/sdb'] Jan 17 18:13:41 ltsrv02 SM: [32406] pread SUCCESS Jan 17 18:13:41 ltsrv02 SM: [32406] Raising exception [16, The SR device is currently in use] Jan 17 18:13:41 ltsrv02 SM: [32406] lock: released /var/lock/sm/5b71ea78-773f-90ce-e244-89e6acc99e87/sr Jan 17 18:13:41 ltsrv02 SM: [32406] ***** generic exception: sr_create: EXCEPTION <class 'SR.SROSError'>, The SR device is currently in use Jan 17 18:13:41 ltsrv02 SM: [32406] File "/opt/xensource/sm/SRCommand.py", line 110, in run Jan 17 18:13:41 ltsrv02 SM: [32406] return self._run_locked(sr) Jan 17 18:13:41 ltsrv02 SM: [32406] File "/opt/xensource/sm/SRCommand.py", line 159, in _run_locked Jan 17 18:13:41 ltsrv02 SM: [32406] rv = self._run(sr, target) Jan 17 18:13:41 ltsrv02 SM: [32406] File "/opt/xensource/sm/SRCommand.py", line 303, in _run Jan 17 18:13:41 ltsrv02 SM: [32406] return sr.create(self.params['sr_uuid'], long(self.params['args'][0])) Jan 17 18:13:41 ltsrv02 SM: [32406] File "/opt/xensource/sm/EXTSR", line 170, in create Jan 17 18:13:41 ltsrv02 SM: [32406] raise xs_errors.XenError('SRInUse') Jan 17 18:13:41 ltsrv02 SM: [32406] File "/opt/xensource/sm/xs_errors.py", line 52, in __init__ Jan 17 18:13:41 ltsrv02 SM: [32406] raise SR.SROSError(errorcode, errormessage) Jan 17 18:13:41 ltsrv02 SM: [32406] Jan 17 18:13:41 ltsrv02 SM: [32406] ***** Local EXT3 VHD: EXCEPTION <class 'SR.SROSError'>, The SR device is currently in use Jan 17 18:13:41 ltsrv02 SM: [32406] File "/opt/xensource/sm/SRCommand.py", line 352, in run Jan 17 18:13:41 ltsrv02 SM: [32406] ret = cmd.run(sr) Jan 17 18:13:41 ltsrv02 SM: [32406] File "/opt/xensource/sm/SRCommand.py", line 110, in run Jan 17 18:13:41 ltsrv02 SM: [32406] return self._run_locked(sr) Jan 17 18:13:41 ltsrv02 SM: [32406] File "/opt/xensource/sm/SRCommand.py", line 159, in _run_locked Jan 17 18:13:41 ltsrv02 SM: [32406] rv = self._run(sr, target) Jan 17 18:13:41 ltsrv02 SM: [32406] File "/opt/xensource/sm/SRCommand.py", line 303, in _run Jan 17 18:13:41 ltsrv02 SM: [32406] return sr.create(self.params['sr_uuid'], long(self.params['args'][0])) Jan 17 18:13:41 ltsrv02 SM: [32406] File "/opt/xensource/sm/EXTSR", line 170, in create Jan 17 18:13:41 ltsrv02 SM: [32406] raise xs_errors.XenError('SRInUse') Jan 17 18:13:41 ltsrv02 SM: [32406] File "/opt/xensource/sm/xs_errors.py", line 52, in __init__ Jan 17 18:13:41 ltsrv02 SM: [32406] raise SR.SROSError(errorcode, errormessage) Jan 17 18:13:41 ltsrv02 SM: [32406] Jan 17 18:13:41 ltsrv02 SM: [32406] lock: closed /var/lock/sm/5b71ea78-773f-90ce-e244-89e6acc99e87/sr [root@ltsrv02 ~]# xe sr-list params=all uuid ( RO) : 8e39261e-e962-7393-a476-c046c57fb99e name-label ( RW): ISORepository name-description ( RW): host ( RO): ltsrv02 allowed-operations (SRO): unplug; plug; PBD.create; PBD.destroy; VDI.clone; scan; VDI.create; VDI.destroy current-operations (SRO): VDIs (SRO): d0dc7629-705c-49d7-b681-dc576a222115; 8812ec77-e698-42ea-b6f6-d571eb46b30f PBDs (SRO): 53020398-dca5-520c-b57c-7f392fed283d virtual-allocation ( RO): 1098485760 physical-utilisation ( RO): -1 physical-size ( RO): -1 type ( RO): iso content-type ( RO): iso shared ( RW): false introduced-by ( RO): <not in database> is-tools-sr ( RO): false other-config (MRW): sm-config (MRO): blobs ( RO): local-cache-enabled ( RO): false tags (SRW): clustered ( RO): false uuid ( RO) : 98a49aaa-989d-96cd-47af-c754c1c27fe5 name-label ( RW): DVD drives name-description ( RW): Physical DVD drives host ( RO): ltsrv02 allowed-operations (SRO): VDI.introduce; unplug; plug; PBD.create; update; PBD.destroy; VDI.clone; scan current-operations (SRO): VDIs (SRO): PBDs (SRO): fe605873-5389-85a4-8954-138c712ea733 virtual-allocation ( RO): 0 physical-utilisation ( RO): 0 physical-size ( RO): 0 type ( RO): udev content-type ( RO): iso shared ( RW): false introduced-by ( RO): <not in database> is-tools-sr ( RO): false other-config (MRW): i18n-original-value-name_description: Physical DVD drives; i18n-original-value-name_label: DVD drives; i18n-key: local-hotplug-cd sm-config (MRO): type: cd blobs ( RO): local-cache-enabled ( RO): false tags (SRW): clustered ( RO): false uuid ( RO) : 3c6d93b1-d0dc-ff54-6014-69eeb9f3c7d9 name-label ( RW): XenServer Tools name-description ( RW): XenServer Tools ISOs host ( RO): ltsrv02 allowed-operations (SRO): unplug; plug; PBD.create; PBD.destroy; VDI.clone; scan current-operations (SRO): VDIs (SRO): a8ddd733-a047-4b97-8812-3405ff21285d; b8da6487-8341-4a13-8877-6e1a3ec8b1d7 PBDs (SRO): 0173a080-31c4-0bb6-9d23-62ce1e36f05c virtual-allocation ( RO): 129933312 physical-utilisation ( RO): -1 physical-size ( RO): -1 type ( RO): iso content-type ( RO): iso shared ( RW): true introduced-by ( RO): <not in database> is-tools-sr ( RO): true other-config (MRW): xensource_internal: true; xenserver_tools_sr: true; i18n-key: xenserver-tools; i18n-original-value-name_label: XenServer Tools; i18n-original-value-name_description: XenServer Tools ISOs sm-config (MRO): blobs ( RO): local-cache-enabled ( RO): false tags (SRW): clustered ( RO): false uuid ( RO) : ce51a8d3-6f8e-7f89-c52c-fae0a6119f1a name-label ( RW): Local storage name-description ( RW): host ( RO): ltsrv02 allowed-operations (SRO): unplug; plug; PBD.create; update; PBD.destroy; VDI.resize; VDI.clone; scan; VDI.snapshot; VDI.create; VDI.destroy current-operations (SRO): VDIs (SRO): 0fc0e9ae-efa6-4af8-9e38-4a836bf9e464; caa1caa0-2aeb-4803-bde3-ad26da40ef9b PBDs (SRO): 27be0f02-c5d9-ec3b-e1b8-3a1780b499ed virtual-allocation ( RO): 21483225088 physical-utilisation ( RO): 21546139648 physical-size ( RO): 75459723264 type ( RO): lvm content-type ( RO): user shared ( RW): false introduced-by ( RO): <not in database> is-tools-sr ( RO): false other-config (MRW): trim_last_triggered: 1484681716.61; i18n-original-value-name_label: Local storage; i18n-key: local-storage sm-config (MRO): allocation: thick; use_vhd: true; devserial: scsi-30550380440010000 blobs ( RO): local-cache-enabled ( RO): false tags (SRW): clustered ( RO): false uuid ( RO) : 19aae83e-9b8e-d9d2-cf3e-370a953d36d8 name-label ( RW): Removable storage name-description ( RW): host ( RO): ltsrv02 allowed-operations (SRO): VDI.introduce; unplug; plug; PBD.create; update; PBD.destroy; VDI.clone; scan current-operations (SRO): VDIs (SRO): PBDs (SRO): cddbc1fa-01d6-e7a0-aafa-14ba61f2332f virtual-allocation ( RO): 0 physical-utilisation ( RO): 0 physical-size ( RO): 0 type ( RO): udev content-type ( RO): disk shared ( RW): false introduced-by ( RO): <not in database> is-tools-sr ( RO): false other-config (MRW): i18n-original-value-name_label: Removable storage; i18n-key: local-hotplug-disk sm-config (MRO): type: block blobs ( RO): local-cache-enabled ( RO): false tags (SRW): clustered ( RO): false [root@ltsrv02 ~]# xe pbd-list params=all uuid ( RO) : fe605873-5389-85a4-8954-138c712ea733 host ( RO) [DEPRECATED]: 74a2e122-a0f8-4f7a-af66-0e80edddaa87 host-uuid ( RO): 74a2e122-a0f8-4f7a-af66-0e80edddaa87 host-name-label ( RO): ltsrv02 sr-uuid ( RO): 98a49aaa-989d-96cd-47af-c754c1c27fe5 sr-name-label ( RO): DVD drives device-config (MRO): location: /dev/xapi/cd currently-attached ( RO): true other-config (MRW): storage_driver_domain: OpaqueRef:c59d0a2f-2a86-5c13-3cc8-3c8418744916 uuid ( RO) : 27be0f02-c5d9-ec3b-e1b8-3a1780b499ed host ( RO) [DEPRECATED]: 74a2e122-a0f8-4f7a-af66-0e80edddaa87 host-uuid ( RO): 74a2e122-a0f8-4f7a-af66-0e80edddaa87 host-name-label ( RO): ltsrv02 sr-uuid ( RO): ce51a8d3-6f8e-7f89-c52c-fae0a6119f1a sr-name-label ( RO): Local storage device-config (MRO): device: /dev/disk/by-id/ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part3 currently-attached ( RO): true other-config (MRW): storage_driver_domain: OpaqueRef:c59d0a2f-2a86-5c13-3cc8-3c8418744916 uuid ( RO) : 0173a080-31c4-0bb6-9d23-62ce1e36f05c host ( RO) [DEPRECATED]: 74a2e122-a0f8-4f7a-af66-0e80edddaa87 host-uuid ( RO): 74a2e122-a0f8-4f7a-af66-0e80edddaa87 host-name-label ( RO): ltsrv02 sr-uuid ( RO): 3c6d93b1-d0dc-ff54-6014-69eeb9f3c7d9 sr-name-label ( RO): XenServer Tools device-config (MRO): path: /opt/xensource/packages/iso; location: /opt/xensource/packages/iso; legacy_mode: true currently-attached ( RO): true other-config (MRW): storage_driver_domain: OpaqueRef:c59d0a2f-2a86-5c13-3cc8-3c8418744916 uuid ( RO) : cddbc1fa-01d6-e7a0-aafa-14ba61f2332f host ( RO) [DEPRECATED]: 74a2e122-a0f8-4f7a-af66-0e80edddaa87 host-uuid ( RO): 74a2e122-a0f8-4f7a-af66-0e80edddaa87 host-name-label ( RO): ltsrv02 sr-uuid ( RO): 19aae83e-9b8e-d9d2-cf3e-370a953d36d8 sr-name-label ( RO): Removable storage device-config (MRO): location: /dev/xapi/block currently-attached ( RO): true other-config (MRW): storage_driver_domain: OpaqueRef:c59d0a2f-2a86-5c13-3cc8-3c8418744916 uuid ( RO) : 53020398-dca5-520c-b57c-7f392fed283d host ( RO) [DEPRECATED]: 74a2e122-a0f8-4f7a-af66-0e80edddaa87 host-uuid ( RO): 74a2e122-a0f8-4f7a-af66-0e80edddaa87 host-name-label ( RO): ltsrv02 sr-uuid ( RO): 8e39261e-e962-7393-a476-c046c57fb99e sr-name-label ( RO): ISORepository device-config (MRO): location: /var/opt/xen/iso_import/; legacy_mode: true currently-attached ( RO): true other-config (MRW): storage_driver_domain: OpaqueRef:c59d0a2f-2a86-5c13-3cc8-3c8418744916 [root@ltsrv02 ~]# pvs PV VG Fmt Attr PSize PFree /dev/sda3 VG_XenStorage-ce51a8d3-6f8e-7f89-c52c-fae0a6119f1a lvm2 a-- 70.28g 50.21g /dev/sdb1 lvm2 --- 223.57g 223.57g [root@ltsrv02 ~]# vgs VG #PV #LV #SN Attr VSize VFree VG_XenStorage-ce51a8d3-6f8e-7f89-c52c-fae0a6119f1a 1 3 0 wz--n- 70.28g 50.21g [root@ltsrv02 ~]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert MGT VG_XenStorage-ce51a8d3-6f8e-7f89-c52c-fae0a6119f1a -wi-a----- 4.00m VHD-0fc0e9ae-efa6-4af8-9e38-4a836bf9e464 VG_XenStorage-ce51a8d3-6f8e-7f89-c52c-fae0a6119f1a -wi------- 16.00m VHD-caa1caa0-2aeb-4803-bde3-ad26da40ef9b VG_XenStorage-ce51a8d3-6f8e-7f89-c52c-fae0a6119f1a -wi-ao---- 20.05g [root@ltsrv02 ~]# ls -l /dev/disk/by-id/ total 0 lrwxrwxrwx 1 root root 9 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C -> ../../sda lrwxrwxrwx 1 root root 10 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part2 -> ../../sda2 lrwxrwxrwx 1 root root 10 Jan 17 17:35 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part3 -> ../../sda3 lrwxrwxrwx 1 root root 10 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part4 -> ../../sda4 lrwxrwxrwx 1 root root 10 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part5 -> ../../sda5 lrwxrwxrwx 1 root root 10 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part6 -> ../../sda6 lrwxrwxrwx 1 root root 9 Jan 17 17:44 ata-KINGSTON_SUV400S37240G_50026B776A04D2C1 -> ../../sdb lrwxrwxrwx 1 root root 10 Jan 17 17:49 ata-KINGSTON_SUV400S37240G_50026B776A04D2C1-part1 -> ../../sdb1 lrwxrwxrwx 1 root root 10 Jan 16 18:33 dm-name-VG_XenStorage--ce51a8d3--6f8e--7f89--c52c--fae0a6119f1a-MGT -> ../../dm-0 lrwxrwxrwx 1 root root 10 Jan 17 08:57 dm-name-VG_XenStorage--ce51a8d3--6f8e--7f89--c52c--fae0a6119f1a-VHD--caa1caa0--2aeb--4803--bde3--ad26da40ef9b -> ../../dm-1 lrwxrwxrwx 1 root root 10 Jan 17 08:57 dm-uuid-LVM-wq1GlQoxNtIu5qJchuwCFKsIsPRHF7MaFJGLYhpDekwnUP3rY2v6yeHQW5L0kZxx -> ../../dm-1 lrwxrwxrwx 1 root root 10 Jan 16 18:33 dm-uuid-LVM-wq1GlQoxNtIu5qJchuwCFKsIsPRHF7Mat2NScw5YjOlcmElOja3wyqqcFkgc309g -> ../../dm-0 [root@ltsrv02 ~]# mount sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) devtmpfs on /dev type devtmpfs (rw,nosuid,size=294320k,nr_inodes=73580,mode=755) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,size=305368k,nr_inodes=76342) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,size=305368k,nr_inodes=76342,mode=755) tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,size=305368k,nr_inodes=76342,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu) cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio) cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory) cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls) configfs on /sys/kernel/config type configfs (rw,relatime) /dev/sda1 on / type ext3 (rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered) xenfs on /proc/xen type xenfs (rw,relatime) hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime) mqueue on /dev/mqueue type mqueue (rw,relatime) debugfs on /sys/kernel/debug type debugfs (rw,relatime) fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime) nfsd on /proc/fs/nfsd type nfsd (rw,relatime) xenstore on /var/lib/xenstored type tmpfs (rw,relatime,size=305368k,nr_inodes=76342,mode=755) /opt/xensource/packages/iso/XenCenter.iso on /var/xen/xc-install type iso9660 (ro,relatime) /dev/sda5 on /var/log type ext3 (rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered) tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=61076k,mode=700) [root@ltsrv02 ~]# xe vm-list params=all uuid ( RO) : 78658d04-ecd5-4195-b103-6bffff370381 name-label ( RW): Control domain on host: ltsrv02 name-description ( RW): The domain which manages physical devices and manages other domains user-version ( RW): 1 is-a-template ( RW): false is-a-snapshot ( RO): false snapshot-of ( RO): <not in database> snapshots ( RO): snapshot-time ( RO): 19700101T00:00:00Z snapshot-info ( RO): parent ( RO): <not in database> children ( RO): is-control-domain ( RO): true power-state ( RO): running memory-actual ( RO): 788529152 memory-target ( RO): <expensive field> memory-overhead ( RO): 9437184 memory-static-max ( RW): 788529152 memory-dynamic-max ( RW): 788529152 memory-dynamic-min ( RW): 788529152 memory-static-min ( RW): 788529152 suspend-VDI-uuid ( RW): <not in database> suspend-SR-uuid ( RW): <not in database> VCPUs-params (MRW): VCPUs-max ( RW): 2 VCPUs-at-startup ( RW): 2 actions-after-shutdown ( RW): Destroy actions-after-reboot ( RW): Destroy actions-after-crash ( RW): Destroy console-uuids (SRO): a36de7c0-629c-26f3-c368-2506beff3bce; 30a12497-2d29-546b-a34a-d00fcee82c33 platform (MRW): allowed-operations (SRO): changing_dynamic_range current-operations (SRO): blocked-operations (MRW): allowed-VBD-devices (SRO): <expensive field> allowed-VIF-devices (SRO): <expensive field> possible-hosts ( RO): <expensive field> HVM-boot-policy ( RW): HVM-boot-params (MRW): HVM-shadow-multiplier ( RW): 1.000 PV-kernel ( RW): PV-ramdisk ( RW): PV-args ( RW): PV-legacy-args ( RW): PV-bootloader ( RW): PV-bootloader-args ( RW): last-boot-CPU-flags ( RO): last-boot-record ( RO): <expensive field> resident-on ( RO): 74a2e122-a0f8-4f7a-af66-0e80edddaa87 affinity ( RW): 74a2e122-a0f8-4f7a-af66-0e80edddaa87 other-config (MRW): storage_driver_domain: OpaqueRef:14f90d13-5d78-31f0-0934-a939d3a6e5f0; is_system_domain: true; perfmon: <config><variable><name value="fs_usage"/></variable><variable><name value="mem_usage"/></variable><variable><name value="log_fs_usage"/></variable></config> dom-id ( RO): 0 recommendations ( RO): xenstore-data (MRW): ha-always-run ( RW) [DEPRECATED]: false ha-restart-priority ( RW): blobs ( RO): start-time ( RO): 19700101T00:00:00Z install-time ( RO): 19700101T00:00:00Z VCPUs-number ( RO): 2 VCPUs-utilisation (MRO): <expensive field> os-version (MRO): <not in database> PV-drivers-version (MRO): <not in database> PV-drivers-up-to-date ( RO): <not in database> memory (MRO): <not in database> disks (MRO): <not in database> networks (MRO): <not in database> PV-drivers-detected ( RO): <not in database> other (MRO): <not in database> live ( RO): <not in database> guest-metrics-last-updated ( RO): <not in database> can-use-hotplug-vbd ( RO): <not in database> can-use-hotplug-vif ( RO): <not in database> cooperative ( RO) [DEPRECATED]: <expensive field> tags (SRW): appliance ( RW): <not in database> start-delay ( RW): 0 shutdown-delay ( RW): 0 order ( RW): 0 version ( RO): 0 generation-id ( RO): hardware-platform-version ( RO): 0 has-vendor-device ( RW): false uuid ( RO) : aeac78a0-7b0a-6c23-20f3-46b90574a95b name-label ( RW): LTSRV03-DNS name-description ( RW): user-version ( RW): 1 is-a-template ( RW): false is-a-snapshot ( RO): false snapshot-of ( RO): <not in database> snapshots ( RO): snapshot-time ( RO): 19700101T00:00:00Z snapshot-info ( RO): parent ( RO): <not in database> children ( RO): is-control-domain ( RO): false power-state ( RO): running memory-actual ( RO): 1082523648 memory-target ( RO): <expensive field> memory-overhead ( RO): 12582912 memory-static-max ( RW): 1073741824 memory-dynamic-max ( RW): 1073741824 memory-dynamic-min ( RW): 1073741824 memory-static-min ( RW): 536870912 suspend-VDI-uuid ( RW): <not in database> suspend-SR-uuid ( RW): ce51a8d3-6f8e-7f89-c52c-fae0a6119f1a VCPUs-params (MRW): VCPUs-max ( RW): 2 VCPUs-at-startup ( RW): 2 actions-after-shutdown ( RW): Destroy actions-after-reboot ( RW): Restart actions-after-crash ( RW): Restart console-uuids (SRO): 850ee089-91a2-793c-524a-2b3c8b845930 platform (MRW): timeoffset: -1; viridian: false; hpet: true; nx: true; acpi: 1; vga: std; cores-per-socket: 1; videoram: 8; device_id: 0001; pae: true; apic: true allowed-operations (SRO): changing_dynamic_range; migrate_send; pool_migrate; changing_VCPUs_live; suspend; hard_reboot; hard_shutdown; clean_reboot; clean_shutdown; pause; checkpoint; snapshot current-operations (SRO): blocked-operations (MRW): allowed-VBD-devices (SRO): <expensive field> allowed-VIF-devices (SRO): <expensive field> possible-hosts ( RO): <expensive field> HVM-boot-policy ( RW): BIOS order HVM-boot-params (MRW): order: ncd HVM-shadow-multiplier ( RW): 1.000 PV-kernel ( RW): PV-ramdisk ( RW): PV-args ( RW): PV-legacy-args ( RW): PV-bootloader ( RW): PV-bootloader-args ( RW): last-boot-CPU-flags ( RO): vendor: GenuineIntel; features: 17cbfbff-c5fa2223-2d93fbff-00000023-00000001-00000603-00000000-00000000-00000000 last-boot-record ( RO): <expensive field> resident-on ( RO): 74a2e122-a0f8-4f7a-af66-0e80edddaa87 affinity ( RW): 74a2e122-a0f8-4f7a-af66-0e80edddaa87 other-config (MRW): vgpu_pci: ; mac_seed: e8e5b24a-4ff3-16c7-8cde-4332f1cf03f3; install-methods: cdrom,nfs,http,ftp; linux_template: true; base_template_name: Ubuntu Xenial Xerus 16.04 dom-id ( RO): 4 recommendations ( RO): <restrictions><restriction field="memory-static-max" max="1610612736000" /><restriction field="vcpus-max" max="32" /><restriction property="number-of-vbds" max="255" /><restriction property="number-of-vifs" max="7" /><restriction field="has-vendor-device" value="false" /><restriction field="allow-gpu-passthrough" value="1" /><restriction field="allow-vgpu" value="1" /></restrictions> xenstore-data (MRW): vm-data: ha-always-run ( RW) [DEPRECATED]: false ha-restart-priority ( RW): blobs ( RO): start-time ( RO): 20170117T09:51:28Z install-time ( RO): 20170115T04:42:58Z VCPUs-number ( RO): 2 VCPUs-utilisation (MRO): <expensive field> os-version (MRO): PV-drivers-version (MRO): micro: -1 PV-drivers-up-to-date ( RO): false memory (MRO): disks (MRO): networks (MRO): PV-drivers-detected ( RO): false other (MRO): platform-feature-multiprocessor-suspend: 1; has-vendor-device: 0; feature-suspend: 1; feature-shutdown: 1; feature-vcpu-hotplug: 1 live ( RO): true guest-metrics-last-updated ( RO): 20170117T10:57:50Z can-use-hotplug-vbd ( RO): unspecified can-use-hotplug-vif ( RO): unspecified cooperative ( RO) [DEPRECATED]: <expensive field> tags (SRW): appliance ( RW): <not in database> start-delay ( RW): 0 shutdown-delay ( RW): 0 order ( RW): 0 version ( RO): 0 generation-id ( RO): hardware-platform-version ( RO): 0 has-vendor-device ( RW): false [root@ltsrv02 ~]# fdisk /dev/sdb WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion. Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): p Disk /dev/sdb: 240.1 GB, 240057409536 bytes, 468862128 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk label type: gpt # Start End Size Type Name Command (m for help): q Link to comment
0 Tobias Kreidl Posted January 18, 2017 Share Posted January 18, 2017 Presumably this is a second local SR drive in addition to what was the original local SR? What exact CLI command was used to create the new SSD-based SR? Also, I see no partition layout on /dev/sdb -- have you tried creating one to see if that makes a difference or not? My recollection is for local storage I've always had to create a partition for the SR to be able to map to. -=Tobias Link to comment
0 Daniel Ghisleni Posted January 18, 2017 Author Share Posted January 18, 2017 Hi Tobias, thanks for your reply! Yes, this is a second local SR drive. Both were connected on the mainboard when XenServer was installed. The command used to create the SSD-based SR was: xe sr-create content-type=user device-config:device=/dev/disk/by-id/ata-KINGSTON_SUV400S37240G_50026B776A04D2C1 host-uuid=74a2e122-a0f8-4f7a-af66-0e80edddaa87 name-label="Local Storage 2" shared=false type=ext It seems to appear on XenCenter, but one second later, it disappear. About the partition layout, I tried with no partitions. No success. So I created one partition and tried again without making fs. No luck. Soon after, I ran mkfs.ext3 and tried again, but it still did not work. Not even with ext2. Obs: after creation of the partition, I appended "-part1" to the device-config, according to ll /dev/disk/by-id/ output for /dev/sdb1. XenServer always shows the same error: The SR operation cannot be performed because a device underlying the SR is in use by the host. Have you any other suggestion? Thank you again. Daniel --- Below, my attempts: Making a partition: [root@ltsrv02 ~]# gdisk /dev/sdb GPT fdisk (gdisk) version 0.8.6 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Command (? for help): d No partitions Command (? for help): n Partition number (1-128, default 1): First sector (34-468862094, default = 2048) or {+-}size{KMGTP}: Last sector (2048-468862094, default = 468862094) or {+-}size{KMGTP}: Current type is 'Linux filesystem' Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'Linux filesystem' Command (? for help): w Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!! Do you want to proceed? (Y/N): Y OK; writing new GUID partition table (GPT) to /dev/sdb. The operation has completed successfully. Partition layout: [root@ltsrv02 ~]# ls -l /dev/disk/by-id/ total 0 lrwxrwxrwx 1 root root 9 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C -> ../../sda lrwxrwxrwx 1 root root 10 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part2 -> ../../sda2 lrwxrwxrwx 1 root root 10 Jan 17 17:35 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part3 -> ../../sda3 lrwxrwxrwx 1 root root 10 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part4 -> ../../sda4 lrwxrwxrwx 1 root root 10 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part5 -> ../../sda5 lrwxrwxrwx 1 root root 10 Jan 16 18:33 ata-KINGSTON_SUV400S37120G_50026B7768007D1C-part6 -> ../../sda6 lrwxrwxrwx 1 root root 9 Jan 18 08:09 ata-KINGSTON_SUV400S37240G_50026B776A04D2C1 -> ../../sdb lrwxrwxrwx 1 root root 10 Jan 18 08:09 ata-KINGSTON_SUV400S37240G_50026B776A04D2C1-part1 -> ../../sdb1 lrwxrwxrwx 1 root root 10 Jan 16 18:33 dm-name-VG_XenStorage--ce51a8d3--6f8e--7f89--c52c--fae0a6119f1a-MGT -> ../../dm-0 lrwxrwxrwx 1 root root 10 Jan 17 08:57 dm-name-VG_XenStorage--ce51a8d3--6f8e--7f89--c52c--fae0a6119f1a-VHD--caa1caa0--2aeb--4803--bde3--ad26da40ef9b -> ../../dm-1 lrwxrwxrwx 1 root root 10 Jan 17 08:57 dm-uuid-LVM-wq1GlQoxNtIu5qJchuwCFKsIsPRHF7MaFJGLYhpDekwnUP3rY2v6yeHQW5L0kZxx -> ../../dm-1 lrwxrwxrwx 1 root root 10 Jan 16 18:33 dm-uuid-LVM-wq1GlQoxNtIu5qJchuwCFKsIsPRHF7Mat2NScw5YjOlcmElOja3wyqqcFkgc309g -> ../../dm-0 Trying to create SR (before running mkfs.ext3): [root@ltsrv02 ~]# xe sr-create content-type=user device-config:device=/dev/disk/by-id/ata-KINGSTON_SUV400S37240G_50026B776A04D2C1-part1 host-uuid=74a2e122-a0f8-4f7a-af66-0e80edddaa87 name-label="Local Storage 2" shared=false type=ext The SR operation cannot be performed because a device underlying the SR is in use by the host. Running mkfs.ext3: [root@ltsrv02 ~]# mkfs.ext3 /dev/sdb1 mke2fs 1.42.9 (28-Dec-2013) Discarding device blocks: done Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 14655488 inodes, 58607505 blocks 2930375 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 1789 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872 Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done Trying to create SR (after running mkfs.ext3): [root@ltsrv02 ~]# xe sr-create content-type=user device-config:device=/dev/disk/by-id/ata-KINGSTON_SUV400S37240G_50026B776A04D2C1-part1 host-uuid=74a2e122-a0f8-4f7a-af66-0e80edddaa87 name-label="Local Storage 2" shared=false type=ext The SR operation cannot be performed because a device underlying the SR is in use by the host. Link to comment
0 Daniel Ghisleni Posted January 19, 2017 Author Share Posted January 19, 2017 Since I have no more answers or suggestions, I'm thinking about re-installing XenServer. Quite a nasty job considering such a powerful system. Thanks for all, specially Tobias, always so helpful! And sorry for my giant posts! Att.. Daniel Link to comment
0 Tobias Kreidl Posted January 19, 2017 Share Posted January 19, 2017 Might also be a function of how the RAID controller handles things. Do you have to make the device known to your server, even if it's a simple RAID0, single-disk colume? I've run into that before with disk drive devices that needed to be configured in the local RAID manager of the server's firmware. -=Tobias Link to comment
0 Daniel Ghisleni Posted January 19, 2017 Author Share Posted January 19, 2017 It is a single disk volume, no RAID configuration needed. The device is known by the system without any special configuration.That is, I simply plugged it on SATA port and it appeared as /dev/sdb. Would it make any difference if I change SATA port of this new SSD drive? I did not try that. And I will check BIOS configuratoins too. Thanks again! Daniel Link to comment
0 aime dev Posted August 28, 2017 Share Posted August 28, 2017 Hi This may be a bit late, but I had a similar problem where the disk I could not add, had been used in a previous version of Xenserver. I used pmagic to clear the partitions, rebooted and added the disk ok. Also, I have added a Crucial SDD with no issues to this system. Did you manage to fix it without a reinstall? Also sometimes disks come with extra goodies on them, l always check to see if its really clean prior to installing. Aimee Link to comment
0 Thierry HOARAU1709161755 Posted March 1, 2020 Share Posted March 1, 2020 Hello Dears same issue, fresh install no SR selected. I xe sr-create ok 1st HDD mounted OK then availlable in XCenter. But impossible to add 2nd local SR same underlying error ... Help and ty all Link to comment
Question
Daniel Ghisleni
Hi,
I'm getting this error when creating a new SR on a new SSD drive:
The SR operation cannot be performed because a device underlying the SR is in use by the host.
I saw lots of topics related to this same error, and tried a lot of procedures. None of them worked for me.
Below there are the results of the commands I run. Hope some one could help me to create a new SR for using as my VMs HDDs.
My new SSD is /dev/sdb. No partitions, no mounting, nothing. Just a new SSD.
Thank you in advance.
Daniel
---
[root@ltsrv02 ~]# cat /var/log/SMlog:
[...]
Link to comment
7 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now