1. Move to a YAML-based configuration format instead of the original INI-based configuration to facilitate better organization and readability. 2. Modify the daemon to be able to operate in several modes based on configuration flags. Either networking or storage functions can be disabled using the configuration, allowing the PVC system to be used only for hypervisor management if required.
		
			
				
	
	
		
			14 lines
		
	
	
		
			462 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			462 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/bash
 | |
| 
 | |
| for disk in $( sudo rbd list ${BLSE_STORAGE_POOL_VM} | grep "^${vm}" ); do
 | |
| 	echo -e "  Disk: $disk"
 | |
| 	locks="$( sudo rbd lock list ${BLSE_STORAGE_POOL_VM}/${disk} | grep '^client' )"
 | |
| 	echo "${locks}"
 | |
| 	if [[ -n "${locks}" ]]; then
 | |
| 		echo -e "   LOCK FOUND! Clearing."
 | |
| 		locker="$( awk '{ print $1 }' <<<"${locks}" )"
 | |
| 		id="$( awk '{ print $2" "$3 }' <<<"${locks}" )"
 | |
| 		sudo rbd lock remove ${BLSE_STORAGE_POOL_VM}/${disk} "${id}" "${locker}"
 | |
| 	fi
 | |
| done
 |