[ClusterLabs] Q: VirtualDomain RA

Roger Zhou zzhou at suse.com
Mon Mar 1 23:04:28 EST 2021


On 3/1/21 7:17 PM, Ulrich Windl wrote:
> Hi!
> 
> I have a question about the VirtualDomain RA (as in SLES15 SP2):
> Why does the RA "undefine", then "create" a domain instead of just "start"ing a domain?
> I mean: Assuming that an "installation" does "define" the domains, why bother with configuration files and "create" when a simple "start" would do also?
> 

It makes sense to clean up the certain situation to avoid the "create" failure. 
Example:

1. given foobar.xml doesn't provide UUID
2. `virsh define foobar.xml`
3. `virsh create foobar.xml` <-- error: Failed to create domain from foobar.xml

Cheers,
Roger


> Specifically this code:
> verify_undefined() {
>          local tmpf
>          if virsh --connect=${OCF_RESKEY_hypervisor} list --all --name 2>/dev/null | grep -wqs "$DOMAIN_NAME"
>          then
>                  tmpf=$(mktemp -t vmcfgsave.XXXXXX)
>                  if [ ! -r "$tmpf" ]; then
>                          ocf_log warn "unable to create temp file, disk full?"
>                          # we must undefine the domain
>                          virsh $VIRSH_OPTIONS undefine $DOMAIN_NAME > /dev/null 2>&1
>                  else
>                          cp -p $OCF_RESKEY_config $tmpf
>                          virsh $VIRSH_OPTIONS undefine $DOMAIN_NAME > /dev/null 2>&1
>                          [ -f $OCF_RESKEY_config ] || cp -f $tmpf $OCF_RESKEY_config
>                          rm -f $tmpf
>                  fi
>          fi
> }
> 
> Regards,
> Ulrich
> 
> 
> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
> 
> ClusterLabs home: https://www.clusterlabs.org/
> 



More information about the Users mailing list