{"id":25,"date":"2012-11-06T01:20:53","date_gmt":"2012-11-06T09:20:53","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=25"},"modified":"2012-11-06T01:21:18","modified_gmt":"2012-11-06T09:21:18","slug":"kvm-vm-rename-and-logical-volume-rename","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/kvm-vm-rename-and-logical-volume-rename\/","title":{"rendered":"KVM VM Rename and Logical Volume Rename"},"content":{"rendered":"

I recently provisioned a Virtual Machine in a KVM Hypervisor with a typo in the name. Even worse I also created the storage LV with a typo. Here is how I fixed it. Off course shut the VM down first.<\/p>\n

LV Rename<\/strong><\/p>\n

# lvrename VolumeGroup oldLVname newLVname\r\n  Renamed \"oldLVname\" to \"newLVname\" in volume group \"VolumeGroup\"<\/pre>\n

Change reference to storage in VM XML<\/strong><\/p>\n

# virsh edit oldVMname\r\nDomain oldVMname XML configuration edited.\r\n\r\n# grep newLVname oldVMname.xml \r\n      <\/pre>\n

Recreate VM<\/strong><\/p>\n

# virsh dumpxml oldVMname > \/tmp\/newVMname.xml\r\n\r\n# virsh undefine oldVMname\r\nDomain newVMname has been undefined\r\n\r\n# grep newVMname \/tmp\/newVMname.xml \r\n  newVMname\r\n      \r\n\r\n# virsh define \/tmp\/newVMname.xml \r\nDomain newVMname defined from \/tmp\/newVMname.xml\r\n\r\n# virsh list --all\r\n Id Name                 State\r\n----------------------------------\r\n  7 aVMname            running\r\n  - newVMname         shut off\r\n\r\n# virsh start newVMname\r\nDomain newVMname started<\/pre>\n","protected":false},"excerpt":{"rendered":"

I recently provisioned a Virtual Machine in a KVM Hypervisor with a typo in the name. Even worse I also<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,6],"tags":[],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-kvm","category-lvm"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=25"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/25\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}