Is there a particular reason you do not want to hardcode the LOD's?Then only reason I can see to create the LODs on the fly like this is if you intend to allow the user to modify them on the fly.You are correct in that you "do" have to load the layer to select the LODs you want from the service in order to set them, and then of course the detroy and rebuild process.Even if you do not hardcode the LODs upfront, you are still in essence hardcoding them, but through code.It seems to me it would just be easier to hardcode the LODs. Just go to the service's directory and copy and paste into your code.example:
//Custom levels of detail listing
customLods = [
{"level" : 0, "resolution" : 9783.93962049996, "scale" : 36978595.474472},
{"level" : 1, "resolution" : 4891.96981024998, "scale" : 18489297.737236},
{"level" : 2, "resolution" : 2445.98490512499, "scale" : 9244648.868618},
{"level" : 3, "resolution" : 1222.99245256249, "scale" : 4622324.434309},
{"level" : 4, "resolution" : 611.49622628138, "scale" : 2311162.217155},
{"level" : 5, "resolution" : 305.748113140558, "scale" : 1155581.108577},
{"level" : 6, "resolution" : 152.874056570411, "scale" : 577790.554289},
{"level" : 7, "resolution" : 76.4370282850732, "scale" : 288895.277144},
{"level" : 8, "resolution" : 38.2185141425366, "scale" : 144447.638572},
{"level" : 9, "resolution" : 19.1092570712683, "scale" : 72223.819286},
{"level" : 10, "resolution" : 9.55462853563415, "scale" : 36111.909643},
{"level" : 11, "resolution" : 4.77731426794937, "scale" : 18055.954822},
{"level" : 12, "resolution" : 2.38865713397468, "scale" : 9027.977411},
{"level" : 13, "resolution" : 1.19432856685505, "scale" : 4513.988705}
];
startExtent = new esri.geometry.Extent(-10947740.873, 2195752.071, -7202937.983, 4181891.814, new esri.SpatialReference({wkid:102100}));
map = new esri.Map("mapDiv", {extent: startExtent, lods: customLods, logo: false});