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
VM rename isn't persistant (vCloud Director) #2761
Comments
I'm not surprised it doesn't work, as the put_vm service request that it depends on was only added somewhat recently. It's probably a small fix to get it wired up into the Model, will look at that shortly (just became a dad tho, so no promises! Not sure why save is not implemented though, again will take a look at why that is - prob docs are out of date. There is a clean workaround for changing the VM name though, which is to do: fog_connection_obj.service.put_vm(id, new_name)
|
@mikepea Thanks for the workaround. Much appreciated. |
@mikepea - congrats on dad-hood! |
There is a way to be able to do it, but it would be good to wire that in to the model. So yeah, we should probably leave this for now. Thanks! |
Hi there, any chance you could expand on how to implement this workaround?
|
For anyone else....
This does the trick |
@trilitheus thanks! |
Re-opened as the suggested fix (calling 'save' method) doesn't work.
Renaming a VM doesn't appear to work/persist in vCloud Director:
irb(main):085:0* vm
=> id="vm-fkgdcca5-725a-4e87-bff3-46ef41480b53",
vapp_id="vapp-56ab1743-d41e-42c3-8bad-8d1a958dc119",
vapp_name="testbox",
name="centos65x64",
type="application/vnd.vmware.vcloud.vm+xml",
href="https://myvdc.example.com/api/vApp/vm-fkgdcca5-725a-4e87-bff3-46ef41480b53",
status="off",
operating_system="Red Hat Enterprise Linux 6 (64-bit)",
ip_address="",
cpu=2,
memory=2048,
hard_disks=[{"Hard disk 1"=>10240}]
Editing it just as you would for cpu or memory changes it but it doesn't remain changed after a reload.
irb(main):105:0* vm.name = "node1"
=> "node1"
irb(main):085:0* vm
=> id="vm-fkgdcca5-725a-4e87-bff3-46ef41480b53",
vapp_id="vapp-56ab1743-d41e-42c3-8bad-8d1a958dc119",
vapp_name="testbox",
name="node1",
type="application/vnd.vmware.vcloud.vm+xml",
href="https://myvdc.example.com/api/vApp/vm-fkgdcca5-725a-4e87-bff3-46ef41480b53",
status="off",
operating_system="Red Hat Enterprise Linux 6 (64-bit)",
ip_address="",
cpu=2,
memory=2048,
hard_disks=[{"Hard disk 1"=>10240}]
irb(main):085:0* vm.reload
=> id="vm-fkgdcca5-725a-4e87-bff3-46ef41480b53",
vapp_id="vapp-56ab1743-d41e-42c3-8bad-8d1a958dc119",
vapp_name="testbox",
name="centos65x64",
type="application/vnd.vmware.vcloud.vm+xml",
href="https://myvdc.example.com/api/vApp/vm-fkgdcca5-725a-4e87-bff3-46ef41480b53",
status="off",
operating_system="Red Hat Enterprise Linux 6 (64-bit)",
ip_address="",
cpu=2,
memory=2048,
hard_disks=[{"Hard disk 1"=>10240}]
Calling the suggested vm.save method doesn't work as the method doesn't seem to exist like it does for the network object.
irb(main):033:0> vm.save
NoMethodError: undefined method save' for #Fog::Compute::VcloudDirector::Vm:0x000000019e48b8
from (irb):33
from /home/mnewman/.rbenv/versions/1.9.3-p448/bin/irb:12:in'
The text was updated successfully, but these errors were encountered: