CLOUDSTACK-6694: Refactor 'assign vm' action into function

Makes 'assign vm' action a function, to fix issue where quickview did
not have updated code.